Oracle 8i connectivity under PHP4 has to be one of THE hardest things to find help with. I have spent the last 2 days trying to get my Windows 98 PC running Apache 1.3.12 and PHP4.0.2 to connect to our Linux-based Oracle 8i server.
Firstly, I CAN connect using SQLPlus, I DO have the Oracle client installed (c:\oracle\ora81) and I DO have a correctly set-up and tested TNSNAMES.ORA (c:\oracle\ora81\network\admin).
I have not been able to establish a connection at all to this box via PHP. I have searched high and low for some sort of complete documentation on the process but have found nothing. I have followed as much instruction that I've been able to find so far, including setting ORACLE_BASE to c:\oracle, ORACLE_HOME to c:\oracle\ora81 and have even tried setting ORACLE_SID even though I believe that is for Oracle 8.0 or lower. All of these environment variables have been set in autoexec.bat, and even tried in httpd.conf using SetEnv directives.
Consistantly my connection attempts fail with the error message "Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name in c:\Windows\Desktop\webs/test.php on line 5".
If anyone has any idea what the problem is I'd love to hear from you. Let me assure you its not something as simple as putting in the wrong Service name... I have read suggestions that say to try putting the fully qualified database name into the OCILogon command instead of the service name which I have also tried without success.
Thanks, and believe me... whoever solves this will be helping a LOT of people.... it seems to be something that happens to a great number of people without any solution as far as I have been able to tell so far.
TIA
Matt