Fatal error: call to undefined function oci_connect ()

I have the following uncommented lines (in my php.ini):

extension=php_oracle.dll extension=php_oci8.dll 

And I downloaded this file instantclient-basiclite-nt-11.2.0.2.0.zip and unpacked it and put it on the D drive ...

I am using Windows XP

I set the environment variable as follows:

 LD_LIBRARY_PATH C:\instantclient_11_2:$LD_LIBRARY_PATH ORACLE_HOME C:\instantclient_11_2 

But when I execute the oci_connect() function, I see this error:

Fatal error: call to undefined oci_connect () in ...

and I found these warnings in the erroeLog file:

[29-Dec-2011 00:36:39] PHP Warning: starting PHP: it is not possible to load the dynamic library 'c: \ php \ ext \ php_oci8.dll' - the specified module was not found. in Unknown on line 0

[29-Dec-2011 00:36:39] PHP Warning: starting PHP: it is impossible to load the dynamic library 'c: \ php \ ext \ php_oracle.dll' - the specified module was not found.

+7
source share
4 answers

What you need to check:

  • You do not need to set LD_LIBRARY_PATH and ORACLE_HOME . However, you need to add D:\instantclient_11_2 to the PATH environment variable and restart the computer so that the changes change.

  • Before setting up PHP, make sure your Oracle client libraries actually work (for example, try connecting to SQL Developer).

  • Comment on extension=php_oracle.dll . It refers to the legacy and legacy Oracle extension.

  • Double check that php_oci8.dll file php_oci8.dll really located at c:\php\ext\php_oci8.dll ?

+4
source

Did you restart apache after placing the php_oci8.dll file in the php/ext directory?

+2
source

Just add this line to the php.in file, indicating the location of the extensions, you should know where they are, but usually in the php folder.

extension_dir = C:\xampp\php\ext ; This is used for me by hampp, wise.

It worked for me. The problem is access to extensions and has nothing to do with oracle libraries.

0
source

All Articles