一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

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

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

首先到oracle官網的這個頁面下載相關的文件,注意要連數據庫服務器的版本,一定要對應,否則安裝成功也會連不上,同時也要區分32位、64位服務器,比如我要連的數據庫服務器是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.然后執行命令

復制代碼 代碼如下:
# 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(這里多運行幾次,直到出現如下提示)
 
[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.創建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

刷新測試頁面。發現oci8出現了,則大功告成.

php技術PHP下的Oracle客戶端擴展(OCI8)安裝教程,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 丝袜亚洲综合 | 第一区免费在线观看 | 久久一本色系列综合色 | 在线观看91精品国产hd | 亚州一二区| 色老大综合久久综合热 | 国产在线2021 | 六月婷婷综合激情 | 婷婷六月久久综合丁香可观看 | 精品一区二区91 | 欧美zoosex | 欧美视频在线观看 | 91精品在线视频观看 | 激情影院a | www.日本高清视频 | 国产一区二区三区不卡观 | 四虎网站网址 | www.av在线视频 | 国产91精选在线观看麻豆 | 国产精品自产拍在线观看 | 4k岛国精品午夜高清在线观看 | 日韩在线视频不卡 | 白丝美女被狂躁视频免费网站 | 韩国免费一级片 | 五月天婷婷激情视频 | 免费一区二区三区免费视频 | 999无色码中文字幕 999影院成 人在线影院 | 国产成人网 | 九九精品在线播放 | 日本成人社区 | 亚洲欧美色中文字幕 | 欧美精品自拍 | 免费黄色视屏网站 | 色婷婷在线观看视频 | 色妞精品一区二区 | 亚洲一区二区三区免费观看 | 韩国特级一级毛片免费网站 | 色吧综合网 | 国产区在线观看 | 国产精品免费久久久久影院小说 | 日韩欧美不卡片 |