- Install PHP and Apache. Check that PHP is working.
- Download the Basic and the SDK Instant Client packages from the OTN Instant Client page. Install the RPMs as the root user:
rpm -Uvh oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
rpm -Uvh oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
The first RPM puts the Oracle libraries in /usr/lib/oracle/11.1/client/lib
The second creates headers in /usr/include/oracle/11.1/client - The latest OCI8 1.3 extension from PECL supercedes the default version in the PHP 5.2 source code. This can be downloaded manually and installed with:
pecl install oci8-1.3.5.tgz - This gives:
downloading oci8-1.3.5.tgz …
Starting to download oci8-1.3.5.tgz (137,987 bytes) …..done: 137,987 bytes
10 source files, building running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Please provide the path to the ORACLE_HOME directory. Use ‘instantclient,/path/to/instant/client/lib’ if you’re compiling with Oracle Instant Client : autodetect 1-1, ‘all’, ‘abort’, or Enter to continue: - Since we have installed the Instant Client RPMs, hit Enter and PECL will automatically locate the RPMs and build and install an oci8.so shared library.
- In php.ini, enable the OCI8 extension with: extension=oci8.so
- Verifying the Extension is Installed
- To check the extension is configured, create a simple PHP script phpinfo.php in the Apache document root:
<?php
phpinfo();
?> - Load the script into a browser using the appropriate URL, e.g. “http://localhost/phpinfo.php”. The browser page will contain an “oci8″ section saying “OCI8 Support enabled”. The OCI8 options that can be configured in your php.ini file are shown.
Advertisement
Filed under: Installations