Install Oci8 Oracle database connections di PHP5 Ubuntu 14.04

Install Oracle Instantclient basic dan Instantclient sdk

  1. Download Instantclient-basic dan instantclient-sdk di situs resmi oracle http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html (sesuaikan OS Linux 32/64 bit)
  2. Saya coba beberapa versi yg jalan menggunakan versi “instantclient-sdk-linux-12.1.0.1.0.zip” dan instantclient-basic-linux-12.1.0.1.0.zip
  3. Extract semua ke masing-masing folder (“tar xzvh xxxxxx”)
  4. Pindahkan isi dari instantclient-basic ke “/opt/oracle/instantclient”
  5. Pindahkan isi dari instantclient-sdk ke “/opt/oracle/instantclient/sdk”
  6. Masuk ke folder “/opt/oracle/instantclient” dan jalankan
    ln -s libclntsh.so.* libclntsh.so
    ln -s libocci.so.* libocci.so
  7. Buka menggunakan text editor file “/etc/ld.so.conf” cth: “sudo nano /etc/ld.so.conf”. Lalu tambahkan di paling bawah  ‘/opt/oracle/instantclient’
  8. Jalankan “ldconfig”

 

Install manual pecl oci8 di ubuntu 14

  1. Download dan extract pecl oci8 http://pecl.php.net/package/oci8 (untuk php 5.x download pecl 2.0.12)
  2. Masuk ke folder hasil extract, lalu jalankan “phpize” via console
  3.  Jalankan “./configure -with-oci8=shared,instantclient,$ORACLE_HOME” atau “./configure -with-oci8=shared,instantclient,<dir path instantclient cth: /opt/oracle/instantclient >”
  4. Jalankan “make install”
  5. Enable extension oci8.so di php5, caranya :
    1. buat file baru di /etc/php5/mods-available isinya extension=oci8.so , cth:
      1. “touch /etc/php5/mods-available/oci8.ini”
      2. “echo ‘extension=oci8.so’ >> /etc/php5/mods-available/oci8.ini “
    2. Jalankan “php5enmod oci8” untuk enable extension
    3. restart / reload service apache”service apache2 reload”
  6. Done

 

referensi:

  • https://askubuntu.com/questions/453449/error-installing-oci8-on-ubuntu-14-04
  • https://gist.github.com/tassoevan/10392954

lib instantclient dan pear oci 8 yg saya pakai (ubuntu 14.04 32 bit, php 5.5)

Leave a Reply

Your email address will not be published. Required fields are marked *