Skip to content

Instantly share code, notes, and snippets.

@ehsanhoushmand
Last active June 15, 2019 12:45
Show Gist options
  • Save ehsanhoushmand/b1c67db7095d67a172bec4fa272099f7 to your computer and use it in GitHub Desktop.
Save ehsanhoushmand/b1c67db7095d67a172bec4fa272099f7 to your computer and use it in GitHub Desktop.
install oracle client and sdk on linux

step 1: get oracle libs

Step 2: install pear and alien

  • sudo apt install alien php7.[php version]-dev php-pear

Step 3: install client

  • sudo alien -i oracle-instantclient*-basic-[oracle_version].rpm
  • sudo alien -i oracle-instantclient*-devel-[oracle_version].rpm [centos yum install systemtap-sdt-devel export PHP_DTRACE=yes pecl install oci8 ]
  • sudo pecl install oci8

Step 4: php mods available

  - sudo sh -c "echo 'extension=oci8.so' > /etc/php/7.[php version]/mods-available/oci8.ini"
  - phpenmod oci8
  - sudo ln -s /etc/php/7.[php version]/mods-available/oci8.ini /etc/php/7.[php version]/cli/conf.d/20-oci8.ini
  - sudo ln -s /etc/php/7.[php version]/mods-available/oci8.ini /etc/php/7.[php version]/fpm/conf.d/20-oci8.ini

step 5: configure (make the path of the oracle libs to be discoverable)

  • sudo sh -c "echo /usr/lib/oracle/[oracle_version]/client64/lib > /etc/ld.so.conf.d/oracle.conf"
  • sudo ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment