PHP oci8在openSUSE上安装失败



在openSUSE Leap 15和php8上运行

pecl install oc8

我得到了这个控制台输出:

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容器中运行:

docker run -d -p 49161:1521 oracleinanutshell/oracle- exe -11g

我假设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

(对于其他版本的DB,您将使用source /usr/local/bin/oraenv)。

最后,如果可以使用Oracle XE 21,为什么要使用Oracle XE 11.2 ?试试docker pull docker.io/gvenzl/oracle-xe:21-slim

如果你在不同的容器上运行PHP,不要忘记安装Oracle即时客户端

最新更新