6

I have Windows XP and recently I installed wamp (apache-mysql-php) 32-bit. I tested the installation (connect to mysql database with php and apache) and everything was working fine.

Now i need to connect to an Oracle database so I tried to enable some extensions related to Oracle and oci8.

And I did:

1) I opened php.ini file and I removed the semicolons before the following lines:

before:

;extension=php_oci8.dll
;extension=php_oci8_11g.dll

after:

 extension=php_oci8.dll
 extension=php_oci8_11g.dll

2) I restarted apache and all Services and i get a

  • "PHP StartUp" Warning.

3) In php_error.log file I get:

 **PHP Warning:  PHP Startup:  in Unknown on line 0**

So, i thought that it would be a good idea to check where my extension php folder is and if those dll files are there.

In php.ini my extension folder is located at:

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

The folder exists and both of these libraries (php_oci8.dll php_oci8_11g.dll) are inside that folder.

4) I added in my 'Path' system variable in Windows the following:

C:\wamp\bin\php\php5.4.16\ext;

5) I copied both of these dll files in Apache's folder but again it didn't work!

C:\wamp\bin\apache\Apache2.4.4\bin 

6) Also, I checked the phpinfo page and the only entry I get for "oci8" is the following:

Configure Command

 "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared"

Hm...the following folders do not exist in my system:

C:\php-sdk\oracle\instantclient10\sdk
C:\php-sdk\oracle\instantclient11\sdk

So, what am I supposed to do next in order to correctly enable the oci8 extensions?

thanks

programmer
  • 4,571
  • 13
  • 49
  • 59
  • 1
    Also, in my own experience, it might help if you _only_ enable one extension, not both. – Passerby Jan 21 '14 at 05:47
  • thanks for replying, I had already read that post and yesterday I downloaded the Instant Client Package - Basic (version 10.2.0.5). The package included some jar and dll files. But I didn't know in which folder I shall place those files and what I shall do next. – programmer Jan 21 '14 at 05:48
  • @Passerby even if I enable only one extension, I get again this PHP warning – programmer Jan 21 '14 at 05:51

2 Answers2

8

[SOLVED]

I downloaded the Instant Client Package - Basic (version 10.2.0.5) and I extracted it.

Afterwards I copied all the files of that package in the following folders:

C:/wamp/bin/php/php5.4.16/ext/
C:/wamp/bin/apache/Apache2.4.4/bin

It worked for me in this way. After that the oci8 module was loaded.

programmer
  • 4,571
  • 13
  • 49
  • 59
  • 1
    You can extract .zip contents to any desired folder just add it to `PATH` environment variable. – Yaroslav Shabalin Jan 21 '14 at 06:27
  • 3
    @Yaroslav: No! That won't work for Apache 2.4+PHP 5.5 64bit on Windows . I've tried that (Add instant client folder as 1st entry in PATH) and php_oci8.dll still causes the warning. Only copying all those files to apache/bin will make things work! Copying them to php/ext is not necessary! – Scott Chu Oct 28 '15 at 09:06
  • @ScottChu solution solved it for me. I am using Apache 2.4+PHP 5.5 64bit on Windows and adding the instant client to the PATH variable did not work for me. However, copy the instant client contents into the root of the apache/bin folder worked for me. – hatmatbbat10 Jan 22 '16 at 16:57
1

When downloading the instantclient, verify that architecture have installed wamp.

In my case instantclient to download the x64 but had installed the x32 and had problems.

Downloaded the correct architecture and it worked fine.

MarmiK
  • 5,639
  • 6
  • 40
  • 49