Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.19 KB

Php7Oci8ExtensionSetup.md

File metadata and controls

49 lines (39 loc) · 1.19 KB

PHP 7 OCI8 Extension setup

The easiest (by far) approach is to compile the extension using the PHP 7 sources.

  • First, upgrade to PHP 7
cat /etc/redhat-release
yum groupinstall "Development Tools"
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install php70w php70w-pdo php70w-mcrypt php70w-mbstring php70w-intl php70w-devel php70w-bcmath php70w-cli php70w-odbc php70w-xml php70w-pear php70w-xdebug
php -v
rpm -Uvh oracle-instantclient11.2-devel-11.2.0.1.0-1.x86_64.rpm
  • Download the PHP sources, matching the current PHP version installed php -v
cd /root
mkdir src
cd src
wget http://be.php.net/distributions/php-7.0.2.tar.gz
tar xfvz php-7.0.2.tar.gz
  • Compile and install the extension
cd php-7.0.2
cd ext
cd oci8
phpize
./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib
make
make install
echo extension=oci8.so > /etc/php.d/oci8.ini
php -i |grep oci
  • Check the Oci8 extension is installed, and restart your PHP engine to apply changes
php -i |grep oci