Oracle 11.1.0.7 and WAMP oci_connect failure

后端 未结 2 800
我在风中等你
我在风中等你 2021-01-20 15:11

I\'m trying to configure a simple connection between my local WAMP server and some Oracle 11.1.0.7 I have. Apparently PHP has all sorts of solutions and magic situations whe

2条回答
  •  别那么骄傲
    2021-01-20 15:55

    1. execute "phpinfo()";
    2. in "Configure Command", you will see something like: "--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared" ... till now ok!
    3. download Oracle "Instant Client for Microsoft Windows 32-bit" and your "SDK" from http://www.oracle.com/technetwork/topics/winsoft-085727.html , even if your Windows is 64-bit: 3.1 download "Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications: instantclient-basic-win32-11.1.0.7.0.zip" 3.2 download "*Instant Client Package - SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client: instantclient-sdk-win32-11.1.0.7.0.zip" 3.4 unpack two zip in same folder, you will see SDK into folder of instantclient_11 after unpacked; till here OK!
    4. copy this unpacked folder to C:\Windows\SysWOW64\instantclient_11_1
    5. create C:\php-sdk\oracle\instantclient11, and copy the content of C:\Windows\SysWOW64\instantclient_11_1 to C:\php-sdk\oracle\instantclient11
    6. Now, ADD to Windows Environment Variable PATH the follow: "C:\Windows\SysWOW64\instantclient_11_1"
    7. And finally, open Wamp and enable php_oci8_11g extension
    8. Check "phpinfo()" again; It works! Why??? Because C:\wamp\bin\php\php5.3.13\ext\php_oci8_11g.dll or C:\wamp\bin\php\php5.3.13\ext\php_oci8.dll are 32-bit DLLs; into 64-bit environment, when your Windows needs a 32-bit version of "Oracle Instant Client", it will seek into C:\Windows\SysWOW64 .

提交回复
热议问题