Chris Jones (of Oracle) has a new post to his OTN blog with a look at tracing in Oracle+PHP applications via some new methods added to the OCI8 extension.
No matter how it was installed, the PHP OCI8 extension provides a procedural API with familiar calls allowing efficient SQL and PL/SQL execution. The extension also supports some advanced Oracle features such as connection pooling. Recently some new OCI8 functions were checked into the PHP source code.
The new functions - oci_set_module_name, oci_set_action and oci_set_client_info - can be used on any existing (or new) Oracle connection to provide a bit more information about what's going on inside. You can get access to this information via the data dictionary views or through the SYS_CONTEXT() function in your SQL statements.