澳门大赌坊PHP下的Oracle客商端扩张(OCI8State of Qatar安装教程

复制代码 代码如下:
# 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

CentOS服务器阳春有相关条件:apache、php5

2.    # cd apr-1.4.6 

1.用以下命令安装

3State of Qatar 编写翻译和安装
# ./configure
–with-php-config=/usr/bin/php-config –with-pdo-oci=/usr/lib/oracle/11.1/client64
# make && make install

假设未有apr本领,运营tomcat 时现身如下提醒:

近期的类型须要用php访谈oracle数据库,不能不在linux下给php安装oci8扩张。php也足以应用pdo访谈oracle数据库,但要么须求安装客商端。

安装极度复杂,必得记录

 

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

PDO_OCI

PDO Driver for OCI 8 and later enabled

 

 

附:再度记录安装流程

 

  1. 安装oci8扩大早先,供给规定的是您的oracle数据库是还是不是在本土的主机上,如是远端访谈oracle的话,那大家必须先安装Oracle
    Instant Client。

安装Oracle Instant Client

下载以下文件:

  • 澳门大赌坊,oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
  • oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm

2、安装 apr-util

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现身了,则旗开得胜.

4)安装oci  和  pdo_oci
安装oci

in a given directory, LIBDIR, you must either use libtool, and

先是到oracle官方网址的那么些页面下载相关的公文,注意要连数据库服务器的版本,必定要对应,不然安装成功也会连不上,同期也要分别30人、陆拾一个人服务器,比方本人要连的数据库服务器是oracle10.2.0.4,六拾壹人主机,那么自身要下载上边多少个公文:

留意:要保证/usr/local/php/lib/php/extensions/no-debug-non-zts-二〇〇六0613/
该目录下有oci8.so文件

3、安装 tomcat-native

复制代码 代码如下:
# yum install libaio
# cd ~
# wget

/usr/lib/oracle/xxxxx/client64/lib/

   – add LIBDIR to the `LD_LIBRARY_PATH’ environment variable

复制代码 代码如下:
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

运用phpize准备 PHP
外挂模块的编写翻译情形,会根据钦点的遭遇变量生成编写翻译时须要的makefile,
phpize是归于php-devel的剧情,所以centos下风华正茂旦运营yum install
php-devel进行安装就能够
 (注意:/usr/local/php/bin/phpize 为作者的php目录,不相同则需改之;)
(假使是六十三位的体系,client改成client64卡塔尔国

specify the full pathname of the library, or use the `-LLIBDIR’

复制代码 代码如下:
# 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

 1卡塔尔 加多动态装载器
 改革/etc/ld.so.conf文件或在ld.so.conf.d文件夹下增添oracle-x86_64.conf文件,
  写入如下你安装的oracle客商端的lib路径

   – use the `-Wl,-rpath -Wl,LIBDIR’ linker flag

2.安装OCI8 PHP扩展

5)编辑php.ini

     during linking

3.然后实施命令

在 /etc/php.d
 中新建叁个pdo_oci.ini的文书,内容写上  extension=pdo_oci.so

more information, such as the ld(1) and ld.so(8) manual pages.

二、安装oracle客户端
# rpm -ivh oracle-intstant*.rpm

5.    # make install 

2) pdo_oci 与 oci8 包
步向自身的php源目录扩张文件
照旧直接下载php的后生可畏体化安装包

网页下找到自身服务器的php版本,下载后tar解压(自身的是php5.3.10)

     during execution

三、配置oracle (这一步选做,先跳过)

     during linking

6)重启apache,让oci生效

/usr/bin/install -c -m 644 aprutil.exp /usr/local/apr/lib

1卡塔尔国走入文件夹
# cd php-5.3.10/ext/pdo_oci/

1.    # tar zxvf apr-util-1.4.1.tar.gz 

(恐怕原因:那几个php和pdo扩大都是用yum安装的,所以pdo_oci要到/etc/php.d
寻觅别的扩张文件)

2.    # cd apr-util-1.4.1 

 

在成品景况中,特别是直接接纳汤姆cat做WEB服务器的时候,您应该选取汤姆cat
Native来加强其性质,详细布署和装置请参见汤姆cat文书档案。

2) 以免pdo_oci对oracle11协助不足,做三个假的ln,骗过编写翻译
# ln -s /usr/include/oracle/xxxxx /usr/include/oracle/10.2.0.1
# ln -s /usr/lib/oracle/xxxxx /usr/lib/oracle/10.2.0.1

6.    # make install

(还恐怕有任何设置方式:参谋
      /usr/local/php/bin/pear install
PDO_OCI-1.0.tgz
   
这时pdo_oci.so安装到了/usr/local/php/lib/php/extensions/no-debug-non-zts-二〇〇七0613/pdo_oci.so

more information, such as the ld(1) and ld.so(8) manual pages.

安装pdo_oci

flag during linking and do at least one of the following:

解决:注释掉  extension=pdo_oci.so

1.    # tar zxvf apr-1.4.6.tar.gz 

安装PHP扩展 下载oci8程序 、解压

  1. cd php-5.3.3/ext/oci8
  2. phpize
  3. export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/:$LD_LIBRARY_PATH
  4. export ORACLE_HOME="/usr/lib/oracle/11.2/client64/"
  5. export CFLAGS="-I/usr/include/oracle/11.2/client64/"
  6. export CXXFLAGS="-I/usr/include/oracle/11.2/client64/"
  7. ./configure --with-php-config=/usr/local/bin/php-config --with-oci8=/usr/lib/oracle/11.2/client64/ (./configure --with-oci8=shared,instantclient,/usr/lib/oracle/12.1/client64/lib/ --with-php-config=/usr/bin/php-config)
  8. make
  9. make isntall

   – have your system administrator add LIBDIR to `/etc/ld.so.conf’

4)修改php.ini
复制生成的pdo_oci到/usr/local/php/include/php/ext/pdo/目录下
    cp
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_oci.so
 /usr/local/php/include/php/ext/pdo/

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注