Debian 9 で apache2 を使用して PHP7.1 をインストールする際にエラーが発生しました。

Debian 9 で apache2 を使用して PHP7.1 をインストールする際にエラーが発生しました。

こんにちは、Debian 9を使用してApacheをインストールしました。その後、apt-getを使用してphp7.0をインストールしましたが、php7.1をインストールする必要があります。最初はこうしました。

# su
# apt-get purge php7.0 

だから私は次からダウンロードしました。http://php.net/downloads.phpPHP 7.1.10を作成してこれを作成する

# ./configure --with-mcrypt
# make
# make install

しかし、phpinfo()php7.0があってそうしました。

# su
# apt-get purge php7.0 
# apt-get autoremove php7.0

そしてphpinfo()それがうまくいかないことを知っています。まだphpがインストールされていないようです。

それからダウンロードhttp://php.net/downloads.phpPHP 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>

これは何の問題ですか?

ベストアンサー1

これにはSuryリポジトリを使用してください(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

Debian リポジトリを使用してソフトウェアをインストールする方が、手動インストールよりはるかに優れています。多くの問題を減らすことができます:)

おすすめ記事