Thinkphp6 连接Oracle数据库

in PHP with 0 comment

主要三步骤:安装oracle客户端、安装oci8扩展、安装pdo_oci扩展

1、安装PHP客户端

下载最新的客户端:
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

然后安装:

rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm

2、安装pdo_oci扩展

下载PHP源码包(对应当前PHP版本),进入/ext/pdo_oci目录

cd php-src-php-7.3.19/ext/pdo_oci

phpize
 ./configure --with-php-config=/www/server/php/73/bin/php-config --with-pdo-oci=instantclient,/usr/lib/oracle/19.6/client64/lib,19.6
make && make install

3、安装OCI8扩展

phpize

./configure --with-oci8=shared,instantclient,/usr/lib/oracle/19.6/client64/lib

make && make install
Responses