Oracle inherently suffers one major setback in performance. Creating a database connection from your application to Oracle is very costly for the CPU to perform. Ideally, it is best to either create a means of creating a pool of connections or keeping connections persistent. Thus, in PHP it is crucial to use persistent connects to the database from your pages. This will assign one connection per instance of the web server (in the case of Apache 1.3+) so that the PHP app can access properly.
In the Oracle libraries of PHP, you need to use the appropriate function dependent upon the version of Oracle available.
ORACLE 7 or 8
putenv("ORACLE_SID=ORACLE");
putenv("ORACLE_HOME=/opt/oracle/oracle/7.3.4");
$db_connect = ora_plogon("user@sid", "password");
$db_cursor = ora_open($db_connect)
ORACLE 8 or 7 with OCI 8 libraries
putenv("ORACLE_HOME=/opt/oracle/oracle/7.3.4");
$db_connect = ociplogon("username", "password", "sid");
Keep in mind that the Oracle and OCI8 library functions require the libraries to be compiled into PHP. Additionally OCI8 requires a thread safe Apache or web server instance.
Oracle is also a bit odd in that it requires the application to set the ORACLE_SID or TWO_TASK and the ORACLE_HOME variable into the environment. Without this information, there will be no connection made.
To be honest, I have never used Oracle with PHP, but these methods have got to help alot. In my work, we currently use Perl (with an integrated connection pool) or Java J2EE implentations. If you are still seeing performance issues after trying persistent connections, I would strongly suggest looking at how your queries are run and optimizing them with a DBA at hand. Oracle can be very finicky in how it performs queries, but when properly tuned, it simply cannot be outperformed in my experience.