一、安装instantclient11.2
Instant Client for Linux x86-64 (64-bit)
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-jdbc-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-*
此时会生成/usr/lib/oracle/11.2/client64/lib/目录
cd /usr/lib/oracle/11.2/client64/lib
vi /etc/ld.so.conf
追加以下内容 — 上面生成文件的路径,没有64的写client/lib/:
/usr/lib/oracle/11.2/client64/lib/
vi /etc/profile
export ORACLE_HOME=/usr/lib/oracle/11.2/client64/
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64:$LD_LIBRARY_PATH
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
source /etc/profile
安装oci8
如果/www/server/php/74/src/ext/oci8/没有,则下载最新的oci8组件
http://pecl.php.net/package/oci8 注意php8版本
tar -xvzf oci8-2.2.0.tgz 放到/www/server/php/74/src/ext/oci8/
cd
/www/server/php/74/bin/phpize
./configure --with-php-config=/www/server/php/74/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib/
make
make install
输出/www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/