on win 64, I installed apache, php etc. Everything works fine, except the oracle part. I can connect to oracle from sql developer which means my tnsnames.ora file is correct. When apache starts, there are no errors in the logs. But when I try to connect to oracle from my database, oracle module php_oci8.dll is not loaded. What am I doing wrong?
+1
A:
Is the dll listed in the php.ini? Can be "php_oci8.dll" or "php_oci8_11g.dll" depending on version of the Instant Client. Did you restart the server after uncommenting one of them?
Did you edit the correct php.ini (stupid question but there are probably at least two, 1 for Apache and 1 for command line).
Does the OCI8 module show in the output of phpinfo() function?
Does the php_error.log contain anything suspicious?
You might want to check out "The Underground Oracle and PHP Manual" for detailed installation / configuration help and check out resources related to PHP in the PHP Developer Center.
eyescream
2010-07-01 21:12:20
yes, I edited the correct ini.OCI8 module does not show up in the phpinfo() function.yes, I restarted the server after changing the ini file.Yes, the file is listed and not commented in the ini file.I don't know where to check for php_error.log, where should I check?Apache error logs do not contain any errors.
2010-07-01 22:01:56
Check the php.ini, you should have a line similar to "error_log = "C:/wamp/logs/php_error.log" (I'm using wampserver.com). Uncomment the line if needed, set error_reporting to E_ALL etc.Is the dll file present in the PHP's "ext" directory? Does the "extension_dir" in the php.ini point to it correctly?
eyescream
2010-07-01 22:39:58
yes, it is present and it points correctly.nothing in the php error log too :(
2010-07-01 23:22:52
do I need to set any environment variables? like ORACLE_HOME etc?
2010-07-01 23:30:11
Don't think so, I don't have ORACLE_HOME set and my Oracle XE works like charm. Besides looks like it fails on the module loading part, not on anything with connnectivity. Can you try loading the module dynamically with dl() function? (you might need to test it with commandline PHP because it's disabled for Apache module PHP as of 5.3.0). Maybe check out the http://forums.devshed.com/php-development-5/php-oci8-dll-won-t-load-on-php-5-0-5t-325971.html too, I'm just puzzled there are no error messages...
eyescream
2010-07-02 06:45:05
ok, I made some progress (couldn't work the past 4 days, just came back to work today). I am able to execute a script, that contains queries to the database from command line. However, the same script does not run from the browser. Looks like its a settings problem.
2010-07-06 13:58:13