欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP下的Oracle客戶端擴展(OCI8)安裝教程

 更新時間:2014年09月10日 16:39:06   投稿:junjie  
這篇文章主要介紹了PHP下的Oracle客戶端擴展(OCI8)安裝教程,本文在Linux系統(tǒng)中實現(xiàn),OCI8是用來連接Oracle數(shù)據(jù)庫的PHP擴展模塊,需要的朋友可以參考下

最近的項目需要用php訪問oracle數(shù)據(jù)庫,不得不在linux下給php安裝oci8擴展。php也可以使用pdo訪問oracle數(shù)據(jù)庫,但還是需要安裝客戶端。

首先到oracle官網(wǎng)的這個頁面下載相關的文件,注意要連數(shù)據(jù)庫服務器的版本,一定要對應,否則安裝成功也會連不上,同時也要區(qū)分32位、64位服務器,比如我要連的數(shù)據(jù)庫服務器是oracle10.2.0.4,64位主機,那么我要下載下面三個文件:

復制代碼 代碼如下:

oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm
oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm

1.用以下命令安裝

復制代碼 代碼如下:

# rpm -ivh oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm    oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm

2.安裝OCI8 PHP擴展

復制代碼 代碼如下:

# yum install libaio
# cd ~
# wget http://pecl.php.net/get/oci8-1.3.5.tgz

3.然后執(zhí)行命令

復制代碼 代碼如下:

# tar zxvf oci8-1.3.5.tgz
# cd oci8-1.3.5/
# /usr/local/php5/bin/phpize  CFLAGS=/usr/lib/oracle/11.2/client64/ CXXFLAGS=/usr/lib/oracle/11.2/client64/
# ./configure --with-php-config=/usr/local/php5/bin/php-config --with-oci8=instantclient,/usr/lib/oracle/11.2/client64/lib/
# make
# make install(這里多運行幾次,直到出現(xiàn)如下提示)
 
[root@webserver02 oci8-1.3.5]# make install
/bin/sh /root/oci8-1.3.5/libtool --mode=install cp ./oci8.la /root/oci8-1.3.5/modules
cp ./.libs/oci8.so /root/oci8-1.3.5/modules/oci8.so
cp ./.libs/oci8.lai /root/oci8-1.3.5/modules/oci8.la
PATH="$PATH:/sbin" ldconfig -n /root/oci8-1.3.5/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /root/oci8-1.3.5/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing shared extensions:     /usr/local/php5/lib/php/extensions/no-debug-zts-20090626/
# cd /usr/local/php5/lib

4.創(chuàng)建ext目錄

復制代碼 代碼如下:

# mkdir ext/

把oci8.so文件拷貝到php.ini 的ext目錄里面
復制代碼 代碼如下:
# cp /root/oci8-1.3.5/modules/oci8.so /usr/local/php5/lib/ext/

5.在php.ini里面加上extension=oci8.so

如下:

復制代碼 代碼如下:

extension_dir = "/usr/local/php5/lib/ext"
extension = "oci8.so"
session.save_path = "/tmp/php"
oci8.privileged_connect = on

重啟apache服務:

復制代碼 代碼如下:

/usr/local/apache2/bin/apachectl stop
/usr/local/apache2/bin/apachectl start

刷新測試頁面。發(fā)現(xiàn)oci8出現(xiàn)了,則大功告成.

相關文章

  • php 網(wǎng)頁游戲開發(fā)入門教程一(webgame+design)

    php 網(wǎng)頁游戲開發(fā)入門教程一(webgame+design)

    網(wǎng)頁游戲開發(fā)入門教程一 webgame+design , 大家可以參考下。
    2009-10-10
  • Laravel 模型關聯(lián)基礎教程詳解

    Laravel 模型關聯(lián)基礎教程詳解

    這篇文章主要介紹了Laravel 模型關聯(lián)基礎教程詳解,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2019-09-09
  • php下幾個常用的去空、分組、調(diào)試數(shù)組函數(shù)

    php下幾個常用的去空、分組、調(diào)試數(shù)組函數(shù)

    dump() 把數(shù)組以數(shù)組格式數(shù)組,有益于調(diào)試 array_chunk() php默認函數(shù) 作用是把函數(shù)平均分組
    2009-02-02
  • php求兩個目錄的相對路徑示例(php獲取相對路徑)

    php求兩個目錄的相對路徑示例(php獲取相對路徑)

    這篇文章主要介紹了php求兩個目錄的相對路徑示例(php獲取相對路徑),需要的朋友可以參考下
    2014-03-03
  • php導入模塊文件分享

    php導入模塊文件分享

    本文給大家分享的是php導入模塊文件分享,主要參數(shù)有導入文件路徑字符串,可以用"."代替"/", 導入文件類型的擴展名(帶"."號),也可以是class/inc(簡寫方式), 如果導入成功則返回true,否則返回異常對象,有需要的小伙伴參考下吧。
    2015-03-03
  • php生成用戶密碼的兩種方式

    php生成用戶密碼的兩種方式

    使用PHP開發(fā)應用程序,尤其是網(wǎng)站程序,常常需要生成隨機密碼,如用戶注冊生成隨機密碼,本文就介紹了幾種方式,感興趣的可以了解一下
    2021-06-06
  • 將博客園(cnblogs.com)數(shù)據(jù)導入到wordpress的代碼

    將博客園(cnblogs.com)數(shù)據(jù)導入到wordpress的代碼

    博客園限制太多,于是決定從博客園(cnblogs)更換自己個人的博客。WORDPRESS口碑還不錯,于是決定用用看。之前發(fā)的數(shù)百篇日志需要導入過來,在網(wǎng)上搜了一會,發(fā)現(xiàn)沒有這個插件,無奈只能自己寫一個
    2013-01-01
  • PHP如何實現(xiàn)跨域

    PHP如何實現(xiàn)跨域

    這篇文章主要介紹了PHP如何實現(xiàn)跨域的相關資料,非常不錯具有參考借鑒價值,需要的朋友可以參考下
    2016-05-05
  • php 生成靜態(tài)頁面的辦法與實現(xiàn)代碼詳細版

    php 生成靜態(tài)頁面的辦法與實現(xiàn)代碼詳細版

    首先說原理。查了那么多資料,發(fā)現(xiàn)不管用什么方法,原理都是一樣的。就是用程序讀取相應的數(shù)據(jù)來替換模版中的變量,然后生成靜態(tài)頁。
    2010-02-02
  • PHP5.4起內(nèi)置web服務器使用方法

    PHP5.4起內(nèi)置web服務器使用方法

    這篇文章主要為大家詳細介紹了PHP5.4內(nèi)置web服務器,內(nèi)置的Web服務器只是提供開發(fā)測試使用,不推薦使用中生產(chǎn)環(huán)境中,具體內(nèi)容請閱讀下文
    2016-08-08

最新評論