This content has been marked as final. Show 6 replies
I have encountered the same problem too.
OCIHandleAlloc? OCI_HTYPE_SVCCTX: OCI_INVALID_HANDLE
However, after reading the FAQ titled "Setting Oracle environment variables prior to starting the web server", my problem was gone!!
Setting all Oracle environment variables before the web server starts is the only safe way to get PHP talking to Oracle. Setting the variables in PHP scripts or the httpd.conf file mostly does not work. "
So, add ORACLE_HOME, LD_LIBRARY_PATH environment in the same script with your Apache and it will work!
set these using PutEnv() in your PHP script.Please avoid doing this if possible. It may work in about 70% of
cases but for the other 30% of the time it causes odd errors because
Oracle may not get initialized correctly when Apache loads it. Your
scripts may even be running fine until you start calling a different
oci_ function and only then fail with odd Oracle messages. Errors
appear to be port, version and function specific.
 This even hit a core PHP developer recently when he was extending