你好我用debian的9安装安装了apache.然后用apt-get安装PHP7.0,但我需要安装PHP7.1,起初我做
# su
# apt-get purge PHP7.0
所以我从http://php.net/downloads.php PHP 7.1.10下载并制作了这个
# ./configure --with-mcrypt
# make
# make install
# su
# apt-get purge PHP7.0
# apt-get autoremove PHP7.0
并且知道PHPinfo()不起作用.我觉得现在没有安装PHP.
然后从http://php.net/downloads.php PHP 7.1.11(今天新增)和里面下载
# tar jxvf PHP-7.1.11.tar.bz2
# apt-get install build-essential
# apt-get install libxml2-dev libmcrypt-dev libjpeg-dev
# cd PHP-7.1.11
# ./configure --with-mcrypt --with-pdo-pgsql=/etc/postgresql/9.6/main --with-openssl=/usr/bin/openssl --with-zlib --with-apxs2=/usr/bin/apxs2
Configuring SAPI modules
checking for Apache 2.0 handler-module support via DSO through APXS... [Fri Oct 27 12:30:45.328686 2017] [core:warn] [pid 12056] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
yes
configure: error: Cannot find OpenSSL's <evp.h>
这有什么问题?
解决方法:
使用Sury repo(https://deb.sury.org/),这是一个小脚本,可以将它添加到你的回购列表中.
#!/bin/bash
# To add this repository please do:
if [ "$(whoami)" != "root" ]; then
SUDO=sudo
fi
${SUDO} apt-get install apt-transport-https lsb-release ca-certificates
${SUDO} wget -O /etc/apt/trusted.gpg.d/PHP.gpg https://packages.sury.org/PHP/apt.gpg
${SUDO} sh -c 'echo "deb https://packages.sury.org/PHP/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/PHP.list'
${SUDO} apt-get update
>资料来源:https://packages.sury.org/php/README.txt
使用Debian repo来安装SW而不是去手动是一个更好的选择,它会避免你很多头痛:)