centos 使用openssl配置php-8.1

mrwjdhj3  于 2022-11-07  发布在  PHP
关注(0)|答案(1)|浏览(300)

我想构建支持openssl 3的php8.1。首先我编译并安装了openssl 3

./config -fPIC shared --prefix=/opt/openssl

make test
make install
ln -s /opt/openssl/lib64/libssl.so.3 /usr/lib64/libssl.so.3
ln -s /opt/openssl/lib64/libcrypto.so.3 /usr/lib64/libcrypto.so.3
sudo mv /bin/openssl /bin/openssl.backup
ln -s /opt/openssl/bin/openssl /usr/bin/
openssl version
OpenSSL 3.0.5 5 Jul 2022 (Library: OpenSSL 3.0.5 5 Jul 2022)

接下来我尝试配置php-8.1

./configure --with-config-file-path=/etc/php \
--sysconfdir=/etc/php.d \
--enable-mysqlnd \
--with-pdo-mysql \
--with-pdo-mysql=mysqlnd \
--with-pdo-pgsql=/usr/bin/pg_config \
--enable-bcmath \
--enable-fpm \
--with-fpm-user=root \
--with-fpm-group=root \
--enable-mbstring \
--enable-phpdbg \
--enable-shmop \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-zlib \
--with-curl \
--with-pear \
--with-openssl=/opt/openssl \
--with-openssl-dir=/opt/openssl \
--enable-pcntl \
--enable-gd \
--with-jpeg \
--with-mysqli \
--with-readline \
--with-freetype \
--with-ldap

我收到一个错误:
正在检查openssl〉= 1.0.2...没有配置:错误:未满足软件包要求(openssl〉= 1.0.2):
找不到软件包'openssl'
如果您以非标准前缀安装软件,请考虑调整PKG_CONFIG_PATH环境变量。
或者,您可以设置环境变量OPENSSL_CFLAGS与OPENSSL_LIBS,以避免调用pkg-config.有关更多详细信息,请参见pkg-config手册页.
我做错了什么?

mpgws1up

mpgws1up1#

良好的配置

./configure  OPENSSL_CFLAGS=-I/opt/openssl/include/ OPENSSL_LIBS="-L/opt/openssl/lib64/ -lssl -lcrypto" \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig \
--with-config-file-path=/etc/php \
--sysconfdir=/etc/php.d \
--enable-mysqlnd \
--with-pdo-mysql \
--with-pdo-mysql=mysqlnd \
--with-pdo-pgsql=/usr/bin/pg_config \
--enable-bcmath \
--enable-fpm \
--with-fpm-user=root \
--with-fpm-group=root \
--enable-mbstring \
--enable-phpdbg \
--enable-shmop \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-zlib \
--with-curl=/opt/curl \
--with-pear \
--with-openssl=/opt/openssl/bin \
--enable-pcntl \
--enable-gd \
--with-jpeg \
--with-mysqli \
--with-readline \
--with-freetype \

相关问题