-
Recent Posts
I’ve been working on a project that requires Oracle OCI8 installed on a development server running RedHat Linux. Here are the steps I took to successfully install this library to be used with PHP/CodeIgniter.
Make sure to download the required libraries from the Oracle website:
Instant Client Downloads for Linux x86-64 (version 12.1.0.1.0 as of June 1, 2014):
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Download / Unzip Steps (from Oracle):
Installing the RPM packages:rpm -ivh instantclient-basic-linux.XXX.rpm
rpm -ivh instantclient-sdk-linux.XXX.rpm
Make sure to install the pre-requisites:yum install php-pear
yum install php-devel
Download the OCI8 extension:pear download pecl/oci8
tar xvzf oci8-1.4.7.tgz
cd oci8-1.4.7/
phpize
Configure the extension with your Oracle client library path (change the path …/12.1/… with your own version):./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib/
Compile and install:make
make install
Configure SELinux: allows httpd to execute programs that require memory addresses that are both executable and writeablesetsebool -P httpd_execmem 1
Add the folowing configuration at the end of php.inivi /etc/php.ini
[OCI8]
extension=oci8.so
Restart Apacheservice httpd restart
or
sudo apachectl restart
Create a PHP test page (test.php), insert the following codes and load the page in the browser:
<?php phpinfo();?>
or directly from the command line:
php -r "phpinfo();"
You should see the OCI8 library installed successfully.
All done!