phpenvでPHP8をインストールするときのエラー一覧

phpenvでPHP8のインストールをしてみたいと思いますがエラーなどを纏めました

インストール環境

  • almalinux
  • php8.0.3

というわけでインストールしていきたいなと思います。

インストール

# /usr/local/bin/phpenv
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer \
| PHPENV_ROOT=/usr/local/bin/phpenv bash

エラーと対応策

configure: error: no acceptable C compiler found in $PATH
dnf install -y gcc
Package 'libxml-2.0', required by 'virtual:world', not found
dnf install -y libxml2-devel
Package 'openssl', required by 'virtual:world', not found
dnf install -y openssl-devel
Package 'sqlite3', required by 'virtual:world', not found
dnf install -y sqlite-devel
configure: error: Please reinstall the BZip2 distribution
dnf install -y bzip2-devel
Package 'libcurl', required by 'virtual:world', not found
dnf install -y libcurl-devel
Package 'libpng', required by 'virtual:world', not found
dnf install -y libpng-devel
Package 'libjpeg', required by 'virtual:world', not found
dnf install -y libjpeg-turbo-devel
Package 'icu-uc', required by 'virtual:world', not found
Package 'icu-io', required by 'virtual:world', not found
Package 'icu-i18n', required by 'virtual:world', not found
dnf install -y libicu-devel
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
dnf install -y gcc-c++
Package 'oniguruma', required by 'virtual:world', not found
dnf --enablerepo=powertools install -y oniguruma-devel
configure: error: Please reinstall readline - I cannot find readline.h
dnf install -y readline-devel
configure: error: Cannot find libtidy
wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/l/libtidy-5.6.0-5.el8.x86_64.rpm
wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/l/libtidy-devel-5.6.0-5.el8.x86_64.rpm
rpm -Uvh libtidy-5.6.0-5.el8.x86_64.rpm
rpm -Uvh libtidy-devel-5.6.0-5.el8.x86_64.rpm
Package 'libxslt', required by 'virtual:world', not found
dnf install -y libxslt-devel
Package 'libzip', required by 'virtual:world', not found
dnf install -y libzip-devel
/usr/local/bin/phpenv/plugins/php-build/bin/php-build: line 400: make: command not found
dnf install -y make
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
dnf install -y autoconf