sudo vi /etc/apt/sources.list |
在sources.list文件中加入下面行
deb http://oss.oracle.com/debian unstable main non-free |
存盤退出并執行下面命令:
sudo groupadd oracle; sudo groupadd dba sudo useradd -d /home/oracle -g oracle -G dba -m -s /bin/bash oracle sudo apt-get update sudo apt-get install bc libaio sudo apt-get install oracle-xe-client |
安裝好oracle-xe-client后,oracle用戶還需配置一下各種環境參數,可以利用
|
進行設置或者直接把環境參數添加到自己的.bash_profile文件中去。
在安裝完client后,應運行sqlplus連接Oracle數據庫來驗證一下client安裝的正確與否。
三、安裝PHP oci8 extension
還是以能夠使用sudo的普通用戶身份運行下面命令:
sudo apt-get install build-essential sudo apt-get install php5-dev php-pear sudo pecl install oci8 |
在下列提示后輸入$ORACLE_HOME的實際路徑(我自己的是/usr/lib/oracle/xe/app/oracle/product/10.2.0/client):
sail@ubuntu:~$ sudo pecl install oci8 downloading oci8-1.2.2.tgz ... Starting to download oci8-1.2.2.tgz (71,806 bytes) .................done: 71,806 bytes 10 source files, building running: phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20050922 Zend Extension Api No: 220051025 Please provide the path to ORACLE_HOME dir. Use 'instantclient,/path/to/instant/client/lib' if you're compiling against Oracle Instant Client [autodetect] : |
在系統編譯安裝好以后,應該在/usr/lib/php5/20051025(我的php是5.1.6版本的)目錄下有一個oci8.so文件。之后執行命令:
sudo vi /etc/php5/apache2/php.ini |
在相應位置加上
extension=oci8.so |
存盤退出后重啟apache2
sudo /etc/init.d/apache2 restart |
現在,我們的“老婆”就大功告成了!用瀏覽器來驗證一下吧!
新聞熱點
疑難解答
圖片精選