linux 在openSUSE上安装PHP oci8失败

zc0qhyus  于 2022-11-22  发布在  Linux
关注(0)|答案(1)|浏览(233)

在openSUSE Leap 15上运行php 8
pecl安装oci 8
控制台输出如下:

downloading oci8-3.2.1.tgz ...
Starting to download oci8-3.2.1.tgz (190,781 bytes)
.........................................done: 190,781 bytes
13 source files, building
running: phpize
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : /path/to/instant/client/lib
building in /tmp/pear/temp/pear-build-rootdGCc7O/oci8-3.2.1
running: /tmp/pear/temp/oci8/configure --with-php-config=/usr/bin/php-config --with-oci8=/path/to/instant/client/lib
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php8 -I/usr/include/php8/main -I/usr/include/php8/TSRM -I/usr/include/php8/Zend -I/usr/include/php8/ext -I/usr/include/php8/ext/date/lib
checking for PHP extension directory... /usr/lib64/php8/extensions
checking for PHP installed headers prefix... /usr/include/php8
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for Oracle Database OCI8 support... yes, shared
checking PHP version... 8.1.12, ok
checking OCI8 DTrace support... no
checking size of long... 8
checking if we're at 64-bit platform... yes
checking Oracle ORACLE_HOME install directory... /path/to/instant/client/lib
checking ORACLE_HOME library validity... configure: error: /path/to/instant/client/lib is not a directory
ERROR: `/tmp/pear/temp/oci8/configure --with-php-config=/usr/bin/php-config --with-oci8=/path/to/instant/client/lib' failed

这个问题是关于什么的?
Oracle数据库正在Docker容器中运行:
数据处理程序运行-d -p 49161:1521 Oracle应用程序 shell /Oracle-xe-11 g

k5ifujac

k5ifujac1#

我假设您将PHP与数据库安装在同一台机器上。
您是否确实看到了文本/path/to/instant/client/lib,或者您是否混淆了某些内容?当提示您输入路径时,您是否输入了文本?如果您使用默认值,请确保在运行pecl之前为ORACLE_HOME和LD_LIBRARY_PATH设置了有效值。使用XE 11.2,可以通过运行

source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

(With其他版本的DB,您将使用source /usr/local/bin/oraenv)。
最后,既然可以使用Oracle XE 11.2版本,为什么还要使用Oracle XE 21版本呢?
如果您在与数据库容器不同的容器上运行PHP,请不要忘记安装Oracle Instant Client

相关问题