我有oracle数据库服务器。我正在使用linux和apache设置新服务器,以创建与oracle远程服务器连接的应用程序。 如何为php 7设置oci8扩展名?
这是用于新的Linux服务器,PHP 7和Apache 2
我已经从此链接https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst下载了即时客户端
将基本包和SDK文件解压缩到某个文件夹后,我将运行此代码
pecl install oci8
并在提示中设置instatclient,/opt/oracle/instantclient
一切运行良好
之后,我就设置了
echo extension=oci8.so >> /etc/php/7.2/cli/php.ini
/etc/init.d/apache2 restart
但是在运行连接php文件后,仍然出现错误
Fatal error: Call to undefined function oci_connect()
当我检查
phpinfo();
oci8仍未设置
我正在使用此代码
php -m | grep 'oci8'
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8.so' (tried: /usr/lib/php/20170718/oci8.so (libnnz19.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/oci8.so.so (/usr/lib/php/20170718/oci8.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
运行此代码时
ldd /usr/lib/php/20170718/oci8.so
linux-vdso.so.1 (0x00007fffae7b2000)
libclntsh.so.19.1 => /opt/oracle/instantclient/libclntsh.so.19.1 (0x00007f6ab132e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6ab0f3d000)
libnnz19.so => not found
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6ab0d39000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6ab099b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6ab077c000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f6ab0562000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6ab035a000)
libaio.so.1 => /lib/x86_64-linux-gnu/libaio.so.1 (0x00007f6ab0158000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f6aaff3d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6ab5568000)
libclntshcore.so.19.1 => not found