Link to home
Start Free TrialLog in
Avatar of alain34
alain34Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Php_oci8 module not working with php when invoked from the command line

I'm trying to connect to Oracle from a php script.
I would like to use the php_oci8 module.
I have change php.ini to load php_oci8.dll extension but I get the following error
PHP Warning:  PHP Startup: oci8: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=1
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0

Where can I find a php_oci8.dll that has a thread-safety=0

I have already downloaded the latest nts version on this page http://www.php.net/downloads.php and I still get the same error.

Can somebody help?

Regards,

Alain
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

You might be able to recompile PHP on Windows from the source code. I've never done it on Windows, but I've heard others that have done it. You'd need Visual Studio with C/C++ installed, or some other C compiler. I'd Google around for compiling php on windows and see what people suggest.

If you're doing all the compiling of PHP and its modules, then everything should work together. It's not exactly simple stuff, but it's possible.
Avatar of alain34

ASKER

Thanks,

I have tried to do that in the past and I failed.
I knew about somebody compiling it and it still didn't work.....

http://perisama.net/downloads/PHP/

Any other options?

Cheers,

Alain
Did the oci module come with the PHP version that you downloaded (the ZIP file is the one that contains all the extensions)?
If the PHP module came from the nts package, then I would double-check to make sure there are no other PHP versions being loaded accidentally. The message you originally posted seems to indicate that it's loading the correct OCI8 module, but it's loading a version of PHP that has thread_safety turned on, which shouldn't be the case (I'm guessing) for an NTS package.  

Are you running PHP from the command line (unpacking the ZIP into a new directory, going to the command line, cd-ing into the directory and running the php.exe binary) or are you accessing PHP from Apache or a web server?
Avatar of alain34

ASKER

I'm running it from the command line doing
c:\php5.nts\php.exe scriptname.php
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Were you able to figure out what was happening?
Avatar of alain34

ASKER

I have many installation of php (ts and nts) and the php.exe for nts was using extension from the apache ts implementation