Oracle/PHP Issue

We're having a situation with Oracle and PHP that I am hoping someone may have encountered and can provide some guidance on.

We have an Oracle 8.1.6 database instance running on a RedHat 7.2 server. The goal is to make a connection to this instance from the web server, which is running Red Hat Enterprise Server 3.0 and using the Oracle 9.2.0.4 client. It is using Apache 2.0.46 and PHP 4.3.2 (oracle, oci8, curl, and dom modules).

The problem is that an ORA-12154 is returned intermittently by the scripts. Sometimes it works; sometimes it doesn't. A simple PHP test script using the ora_logon and ora_logoff works fine, consistently and without fail.

However, if we add in some ora_parse, ora_open, ora_exec, and ora_close calls then we start getting the aforementioned errors. Again, not all the time, just some of the time. There is no pattern that we have been able to discern.

By their very nature, intermittent errors are very maddening. If there are any PHP wizards who might have encountered this "feature" and know the problem, fix, workaround, hack, etc. and would be willing to share them would earn much gratitude.