I've installed Apache 2.0.58 and PHP 5.1.4, on SuSe linux. The oracle client is 10g Release 2, 10.2.0.1. PHP built and installed fine.
Testing from the command line, it actually works with the following test:
oracle.php
<?php
if ($c=OCIlogon("myuserid@TNS_ENTRY","tstpwd")) {
echo "Successfully connected to Oracle.\n";
ocilogoff($c);
} else {
echo "Oracle Connect Error\n<br><pre>".print_r(ocierror())."</pre>";
}
?>
output:
SERVER.NAME:/usr/local/apache2/htdocs # /usr/local/bin/php oracle.php
<font color=ff0000>
Warning: ocilogon(): ORA-12162: TNS:net service name is incorrectly specified in
/usr/local/apache2/htdocs/oracle.php on line 3
</font>Array
(
[code] => 12162
[message] => ORA-12162: TNS:net service name is incorrectly specified
[offset] => 0
[sqltext] =>
)
Oracle Connect Error
<br>1</pre>
SERVER.NAME:/usr/local/apache2/htdocs #
It errors out because it doesn't find the TNS entry, but alas, it does know that those functions exist, and the script does run.
Here are the PHP confige options:
./configure
--with-zlib-dir=/usr/local/lib
--enable-soap
--disable-cgi
--with-apxs2=/usr/local/apache2/bin/apxs
--without-sqlite
--without-pdo-sqlite
--with-oci8=/oracle/client_10_2_0
--with-oracle=/oracle/client_10_2_0
OK, the problem: When oci8 and oracle are compiled in, when I try to access apache (anywhere, even a basic HTML page), the browser just hangs, nothing, no output. It also hangs indefinitely, it doesn't even timeout, just hangs with "Waiting for MY.IP.ADDRESS.BLA". No errors seem to be logged in /var/log/messages, nor /var/log/apach2/error_log
Apache also starts up without missing a beat.
I've tried compiling oci8 as a seperate module, and I've tried with compiling it into PHP - same result.
The ORACLE_HOME env var is set, and the LD_LIBRARY_PATH var is set to the lib path for the oracle client.
Any ideas?