linux 安裝oci 擴充

來源:互聯網
上載者:User

標籤:c   style   class   blog   a   http   

 1、下載Oracle即時用戶端程式包 — Basic: 運行 OCI、OCCI 和 JDBC-OCI 應用程式所需的所有檔案

  ①、開啟以下網址(本文以32位版為例):
  (Linux 32位版)http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
  (Linux 64位版)http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64soft.html

  ②、下載以下幾個檔案:

       oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
       oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
       oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm



  2、安裝Oracle即時用戶端程式包

rpm -ivh oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
echo "/usr/lib/oracle/11.1/client/lib/" > /etc/ld.so.conf.d/oracle_client.conf
/sbin/ldconfig



  3、安裝OCI8 PHP擴充(使用PHP內建的OCI8,假設PHP程式安裝在/usr/local/webserver/php/)

yum install libaio
wget http://pecl.php.net/get/oci8-1.3.5.tgz
tar zxvf oci8-1.3.5.tgz
cd oci8-1.3.5/
/usr/local/webserver/php/bin/phpize
CFLAGS="-I/usr/include/oracle/11.1/client/"
CXXFLAGS="-I/usr/include/oracle/11.1/client/"
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-oci8=/usr/lib/oracle/11.1/client/
make
make install



  4、修改PHP設定檔(/usr/local/webserver/php/etc/php.ini)
在extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"後增加一行:

extension = "oci8.so"



  5、重啟PHP

  6、建立一個phpinfo.php檔案(內容如下)並通過Web訪問,如果有“oci8”這一項,則表明安裝成功。

<?php
phpinfo();
?>


  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.