The OCI package is required for PHP to remotely connect to Oracle. This package is provided by oracle. You can directly install the Oracle InstantClient to obtain this package.
Http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html
Easy to install
Rpm-Uvh oracle-instantclient-basic-10.2.0.3-1.i386.rpm
Rpm-Uvh oracle-instantclient-devel-10.2.0.3-1.i386.rpm
After the installation is complete, you can view the installed library file in/usr/lib/oracle.
After the need to re-compile php, coupled with -- with-oci8 = share, instantclient,/usr/lib/oracle/10.2.0.3/client/lib parameters, as follows:
./Configure -- with-mysql -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-oci8 = share, instantclient,/usr/lib/oracle/10.2.0.3/client/lib
Test code:
<? Php
$ Conn = OCILogon ('username', 'Password', '192. 168.1.2/test ');
If (! $ Conn ){
$ E = oci_error ();
Print htmlentities ($ e ['message']);
Exit;
}
Else
{
Echo "Successfully connected to Oracle! \ N ";
Ocilogoff ($ conn );
}
?>
Related links:
Http://www.oracle.com/technology/pub/notes/technote_php_instant.html
There is also the oci compilation parameters in php. You can see the README of ext/oci8 in the php original code Directory, which has an explanation.