Home » Open Source » Programming Interfaces » Cannot Connect to Oracle, PHP cannot load oci dlls (Windows, Oracle 9, Wamp)
Cannot Connect to Oracle, PHP cannot load oci dlls [message #465032] Mon, 12 July 2010 05:38 Go to next message
phplebanon
Messages: 4
Registered: July 2010
Junior Member
Hello,
I have installed wamp on windows server, and oracle 9, When I try to connect to oracle in php I get:

Fatal error: Call to undefined function oci_connect() in C:\wamp\www\project2\index.php on line 3

Also when I start wamp, it cannot load the oci dlls found on:
C:\wamp\bin\php\php5.3.0\ext
I have configured the php.ini file and commented as much options

extension_dir = "C:/wamp/bin/php/php5.3.0/ext/"

extension=php_oci8.dll ; Use with Oracle 10gR2 Instant ...
extension=php_oci8_11g.dll ; Use with Oracle 11g Instant Client
extension=php_oracle.dll
extension=oci8.so

I am unable to either connect to the database through php, also when I start wamp, i get pop up windows that it cannot load the dynamic procedures related to oracle: php_oce.dll, php_oce8.dll, php_pdo_oci,

I have even eddited the http.conf file

Also have done this:

•Add the following entries to the "C:\Apache\Apache\conf\httpd.conf" file:

LoadModule php4_module c:\php\sapi\php4apache.dll (approx line 193)
AddModule mod_php4.c (approx line 241)
AddType application/x-httpd-php .php (approx line 851)


Your Help is appreciated
Re: Cannot Connect to Oracle, PHP cannot load oci dlls [message #465034 is a reply to message #465032] Mon, 12 July 2010 05:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Post phpinfo page.

Regards
Michel
Re: Cannot Connect to Oracle, PHP cannot load oci dlls [message #465040 is a reply to message #465032] Mon, 12 July 2010 06:01 Go to previous messageGo to next message
phplebanon
Messages: 4
Registered: July 2010
Junior Member
Hello,
I have included the phpinfofile attached as well, part of it below is:

System Windows NT SELECAO 5.2 build 3790 (Windows Server 2003 Standard Edition Service Pack 2) i586
Build Date Jun 29 2009 21:23:30
Compiler MSVC6 (Visual C++ 6.0)
Architecture x86
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "--with-enchant=shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File C:\wamp\bin\php\php5.3.0\php.ini
.....
Configuration
apache2handler
Apache Version Apache/2.2.11 (Win32) PHP/5.3.0
Apache API Version 20051115
Server Administrator admin@localhost
Hostname:Port localhost:80
Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 300 - Keep-Alive: 5
Virtual Server No
Server Root C:/wamp/bin/apache/Apache2.2.11
Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_actions mod_alias mod_asis mod_auth_basic mod_authn_default mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_setenvif mod_php5
  • Attachment: phpinfo().txt
    (Size: 28.06KB, Downloaded 2888 times)
Re: Cannot Connect to Oracle, PHP cannot load oci dlls [message #465045 is a reply to message #465040] Mon, 12 July 2010 06:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Your configuration indicates:
      "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" 
      "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" 
      "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" 

That is 10g and 11g client
And the path is
      PATH 
C:\wamp\bin\php\php5.3.0\ext;
C:\oracle\ora9i\jre\1.4.2\bin\client;
C:\oracle\ora9i\jre\1.4.2\bin;
C:\oracle\ora9i\bin;C:\Program Files\Oracle\jre\1.3.1\bin;
C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\system32\WindowsPowerShell\v1.0 

which points to a 9i client (as well as other variables).

So choose a client and stay with it for the whole configration. Check that the client you choose is actually installed on your Apache server.

Regards
Michel

[Updated on: Mon, 12 July 2010 07:49]

Report message to a moderator

Re: Cannot Connect to Oracle, PHP cannot load oci dlls [message #465051 is a reply to message #465045] Mon, 12 July 2010 06:34 Go to previous messageGo to next message
phplebanon
Messages: 4
Registered: July 2010
Junior Member
Sorry I could not get what you mean
Re: Cannot Connect to Oracle, PHP cannot load oci dlls [message #465053 is a reply to message #465051] Mon, 12 July 2010 06:37 Go to previous messageGo to next message
phplebanon
Messages: 4
Registered: July 2010
Junior Member
This section if present on the Environment path:
C:\wamp\bin\php\php5.3.0\ext;
it os also present on the php.ini file, by the way, I Have editted the default php.ini file which is launched from wamp, I also then eddited the php.ini found on php folder with the same setting
Re: Cannot Connect to Oracle, PHP cannot load oci dlls [message #465067 is a reply to message #465051] Mon, 12 July 2010 07:47 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
phplebanon wrote on Mon, 12 July 2010 13:34
Sorry I could not get what you mean

Oracle has several versions.
You said you compile with one version, and then you point to another version. This is not compatible.
You have to:
- Ensure you have an Oracle client installed on your Apache server
- Compile/Configure your PHP to use this Oracle client

Regards
Michel
Previous Topic: ORA-12154: TNS:could not resolve service name
Next Topic: ERROR - Internal Error: Image is a collection image, expecting ADT
Goto Forum:
  


Current Time: Thu Mar 28 09:45:40 CDT 2024