Skip to content

Instantly share code, notes, and snippets.

@arcostasi
Last active December 26, 2016 09:59
Show Gist options
  • Save arcostasi/e06ee7ae06d4c5c88987 to your computer and use it in GitHub Desktop.
Save arcostasi/e06ee7ae06d4c5c88987 to your computer and use it in GitHub Desktop.
Install PHP OCI8
#1. Download the desired Instant Client RPM packages. All installations require the Basic or Basic Lite RPM.
http://download.oracle.com/otn/linux/instantclient/121020/oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
http://download.oracle.com/otn/linux/instantclient/121020/oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
#2. As the root user, install the packages with "rpm". For example:
rpm -ivh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
rpm -ivh oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
#3. Set the environment variable LD_LIBRARY_PATH to the appropriate directory for the Instant Client version, for example:
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:$LD_LIBRARY_PATH
#Alternatively, add this path to an ldconfig configuration file if there is no other Oracle software that will be impacted.
#4. To use supplied binaries such as SQL*Plus, update your PATH environment variable, for example:
export PATH=/usr/lib/oracle/12.1/client64/bin:$PATH
#Install OCI8
#1. Download OCI8
wget http://www.crmall.com/oracle/oci8-2.0.8.tgz
#OR
#wget http://pecl.php.net/get/oci8 -O oci8-2.0.8.tgz
#2. Descompactar
tar -zxvf oci8-2.0.8.tgz
cd oci8-2.0.8/
#3. Configure, make && make install OCI8
phpize
./configure --with-oci8=shared,instantclient,/usr/lib/oracle/12.1/client64/lib
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment