编译参数:
./configure --prefix=/usr/local/php56 --with-config-file-path=/etc/php56 --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl
报错信息:
Makefile:623: recipe for target ‘ext/openssl/openssl.lo’ failed
make: *** [ext/openssl/openssl.lo] Error 1
查看openssl版本后,发现是比较新的1.1.1
root@LogCenter:~/php-5.6.38# openssl version
OpenSSL 1.1.1-pre2 (alpha) 27 Feb 2018
根据网上资料,发现debian9.9自带的这个openssl版本,php5.6不支持。
所以手动安装1.0.2的openssl
https://www.openssl.org/source/openssl-1.0.2k.tar.gz
解压后进入文件夹
./config
make
make install
mv /usr/local/bin/openssl /usr/local/bin/openssl1.1.1
ln -s /usr/local/ssl/bin/openssl /usr/local/bin/openssl
再次尝试
make clean
重新configure,并指定openssl目录:
./configure --prefix=/usr/local/php56 --with-config-file-path=/etc/php56 --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl=/usr/local/ssl --enable-bcmath --enable-soap --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl
make没有报错,问题解决