7

I have the next lines uncommented (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 unzipped and put that on drive D...

I am using Windows XP

I set environment variable like this:

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

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

Fatal error: Call to undefined function oci_connect() in ...

and i found this warnings on erroeLog file:

[29-Dec-2011 00:36:39] PHP Warning: PHP Startup: Unable to load dynamic library 'c:\php\ext\php_oci8.dll' - The specified module could not be found. in Unknown on line 0

[29-Dec-2011 00:36:39] PHP Warning: PHP Startup: Unable to load dynamic library 'c:\php\ext\php_oracle.dll' - The specified module could not be found.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
afsane
  • 1,889
  • 6
  • 25
  • 40
  • What messages do the CLI version or Apache output? Also what do the log files or the system log thingy say? – mario Dec 26 '11 at 13:06
  • This should help for the above error!! [Link](http://stackoverflow.com/a/39770392/3973543) – Mahesh G Sep 29 '16 at 13:56

3 Answers3

4

Things to check:

  • You don't need to set LD_LIBRARY_PATH nor ORACLE_HOME. However, you need to add D:\instantclient_11_2 to the PATH environmental variable and restart the computer so changes apply.

  • Before configuring PHP, check that your Oracle client libraries actually work (for instance, try to connect with SQL Developer).

  • Comment out the extension=php_oracle.dll. It belongs to the old and deprecated Oracle extension.

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

Jeffrey Kevin Pry
  • 3,266
  • 3
  • 35
  • 67
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • @afsane - Then it's obvious: it it doesn't work standalone, it can't work under PHP. – Álvaro González Dec 27 '11 at 09:11
  • I have the same problem, and find commented the php_oci8.dll in ini file and see beside another comment like this: "Use with Oracle 10gR2 Instant Client". it's referred to your first point of things to check? What's teh difference using instantclient or uncomment the php_oci8.dll in ini file? – Andrea_86 Oct 20 '14 at 13:26
  • @Andrea_86 - The same difference that exists between using PHP and using Apache: different stuff, both required. – Álvaro González Oct 20 '14 at 14:11
2

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

Tom van der Woerdt
  • 29,532
  • 7
  • 72
  • 105
0

Just add this line to the php.in file that point to the location of extensions, should know where they are located, but normally in php folder.

extension_dir = C:\xampp\php\ext ;this is for me using xampp, be wise.

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

pravprab
  • 2,301
  • 3
  • 26
  • 43