What potential pitfalls should be considered when trying to enable OCI for PHP on a CentOS server running httpd?

Enabling OCI for PHP on a CentOS server running httpd may require installing the necessary Oracle Instant Client libraries and configuring the PHP OCI8 extension. Potential pitfalls to consider include ensuring the correct version compatibility between the Oracle Instant Client libraries and the PHP OCI8 extension, setting the correct environment variables for the Oracle Instant Client, and properly configuring the httpd server to load the OCI8 extension.

// Example PHP code snippet to enable OCI for PHP on a CentOS server running httpd

// Load the OCI8 extension
extension=oci8.so

// Set the Oracle Instant Client environment variables
putenv('ORACLE_HOME=/path/to/oracle/instantclient');
putenv('LD_LIBRARY_PATH=/path/to/oracle/instantclient');

// Connect to Oracle database using OCI functions
$conn = oci_connect('username', 'password', 'hostname:port/servicename');