Greetings folks. I'm having a problem that I'm hoping somebody else has run into and can mebbe shed some light on. I'm trying to connect a PHP script running on Win 2k / IIS to Oracle 8i. There's a catch though.
PHP loads the OCI8 dll correctly, no problems there. We've figured out what it takes to get PHP to connect to oracle as long as the oracle server is on the same physical machine. We had to perform a couple of putenv() calls:
//database we're connecting to
putenv("ORACLE_SID=ORCDEV.OURDOMAIN.COM");
//home directory of oracle installation
putenv("ORACLE_HOME=d:/oracle/ora81");
//path to the TNSNAMES.ORA file
putenv("TNS_ADMIN=d:/oracle/ora81/network/admin");
note the backslashes were getting munged and have been transposed to slashes (/) for readability in the block above.
Performing that, PHP will connect, query, insert, the whole 9 yards. The problem gets to be when we're attempting to get this same php script to connect to the same database, only from a remote webserver. The same script, unmodified, does not work, it returns an OCI error:
_oci_open_server: ORA-12640: Authentication adapter initialization failed
I've seen notes to the effect of copying the entire database connection definition from the TNSNAMES.ORA file into a big string and using that as the database parameter in the OCILogon() call. This does not do the trick. Using this method will work on the Oracle server. Remotely, it does not.
Out of curiosity, I tried the php_oracle.dll extension, that produced the same error message.
This has been tried with both PHP 4.2.3 and 4.1.2, both running in ISAPI mode.
And before you ask the obvious, yes I do have the oracle client installed on the target machine, and it connects to the server without a problem.
We've been trying anything and everything we can think of and so far have not succeeded. Any help is greatly appreciated!