- Download the Basic and SDK zip files from the official Oracle website.
- Create the following directory to store the instant client files
/opt/oracle/instantclient/ - Unzip the basic.zip file into the above directory
- Create the following directory to store the sdk files
/opt/oracle/instantclient/sdk/ - Unzip the sdk.zip file into the above directory
- Create the following two symbolic links
- ln -s libocci.so.11.1 libocci.so
- ln -s libclntsh.so.11.1 libclntsh.so
2. Install the oci8 module
For some reason on my system the automated build process failed.
This is an automated way of building and installing the module.
- Run the command to download and build the module
sudo pecl install oci8 - When prompted enter the location of the instant client libraries
instantclient,/opt/oracle/instantclient - Congratulations, the library should now be installed
- Follow steps 14 and 15 to check that it is loading correctly. If it isn’t you may need to do steps 10 – 13 as well
If the automated script fails to find the instant client libraries follow this procedure
- Abort the automated build process Ctrl-C
- Change to the following directory
/tmp/pear/download - Copy the oci8-1.3.4.tgz to a suitable location, such as a sub directory in your home directory
Note: the file name may be different depending on the version of the of the module - Extract the contents of the file
tar -xzf oci8-1.3.4.tgz - Change into the new directory
cd oci8-1.3.4 - Prepare the source code for building by executing this command
phpize - Configure the source code for building by executing the following command
./configure –with-oci8=shared,instantclient,/opt/oracle/instantclient - Build the module by executing the following command
make - Install the newly built software
sudo make install - Change to the PHP 5 config directory
cd /etc/php5/conf.d - Open a new file in VI for editing
sudo vi oci8.ini - Add the following line to the file
extension=oci8.so - Write the file and quit VI
- Restart the Apache2 server
sudo /etc/init.d/apache2 restart - Check to ensure the module is loading using the phpinfo() function



No comments:
Post a Comment