CentOS下PHP安装Oracle扩展_php技巧
程序员文章站
2022-03-26 18:57:06
...
环境
oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm
oracle-instantclient-jdbc-10.2.0.4-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm
oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm
# rpm -ivh *.rpm
下载Oracle的PHP扩展
wget http://pecl.php.net/get/oci8-2.0.7.tgz
# tar zxvf oci8-2.0.7.tgz
# cd oci8-2.0.7
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/10.2.0.4/client64/lib/
# make && make install
更改php.ini
# vi /usr/local/php/etc/php.ini
增加 extension = "oci8.so"
ps aux | grep php | grep root
kill -USER2 php_root_pid
System:CentOS 6
PHP: 5.3.28
下载Oracle客户端
复制代码 代码如下:
oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm
oracle-instantclient-jdbc-10.2.0.4-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm
oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm
执行安装:
复制代码 代码如下:
# rpm -ivh *.rpm
下载Oracle的PHP扩展
复制代码 代码如下:
wget http://pecl.php.net/get/oci8-2.0.7.tgz
# tar zxvf oci8-2.0.7.tgz
# cd oci8-2.0.7
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/10.2.0.4/client64/lib/
# make && make install
更改php.ini
复制代码 代码如下:
# vi /usr/local/php/etc/php.ini
增加 extension = "oci8.so"
重新启动PHP
复制代码 代码如下:
ps aux | grep php | grep root
kill -USER2 php_root_pid
推荐阅读
-
CentOS7 下nginx与PHP的安装与配置
-
Centos7下编译安装配置Nginx+PHP+MySql环境
-
CentOS 6/7环境下通过yum安装php7的方法
-
Centos7下PHP安装gd库的实例讲解
-
centos6.6 下 安装 php7 + nginx环境的方法
-
centos下yum搭建安装linux+apache+mysql+php环境教程
-
centos7安装php7.3的redis扩展(不是redis服务!)
-
Linux下PHP安装mcrypt扩展模块笔记
-
CentOS 6.3下安装PHP xcache扩展模块笔记
-
Centos下升级php5.2到php5.4全记录(编译安装)