ささきしき

チラシ

phpenvのよくあるエラーとその回答集

<?= $aisatsu ?>

備忘録です。 更新:13 Sept, 2018.

anyenv経由、環境はxenial(Ubuntu)です。

下準備

$ git clone https://github.com/riywo/anyenv ~/.anyenv
$ git clone https://github.com/znz/anyenv-update.git ~/.anyenv/plugins/anyenv-update
$ vim .zshrc
# anyenv
if [ -d $HOME/.anyenv ] ; then
  export PATH="$HOME/.anyenv/bin:$PATH"
  eval "$(anyenv init -)"
fi
$ exec $SHELL -l
$ anyenv install phpenv
$ exec $SHELL -l

本題

$ phpenv install 7.2.9

する前に入れといたほうが良いパッケージと、パッケージ未インストール時のエラー内容。表順はエラー吐いた順。

sudo apt install bison re2c libxml2-dev libssl-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libreadline-dev libtidy-dev libxslt-dev libzip-dev autoconf
  • bison
    • WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: ).
  • re2c
    • WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
  • libxml2-dev / libxml2-devel
    • error: xml2-config not found. Please check your libxml2 installation.
  • libssl-dev
    • configure: error: Cannot find OpenSSL's <evp.h>
  • libbz2-dev
    • configure: error: Please reinstall the BZip2 distribution
  • libcurl4-openssl-dev
    • error: cURL version 7.10.5 or later is required to compile php with cURL support
  • libjpeg-dev / libjpeg-devel
    • error: jpeglib.h not found.
  • libpng-dev / libpng-devel
    • error: png.h not found.
  • libreadline-dev
    • error: Please reinstall readline - I cannot find readline.h
  • libtidy-dev
    • error: Cannot find libtidy
  • libxslt-dev
    • error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
  • libzip-dev
    • WARNING: Use system library and --with-libzip is recommended.
    • error: Please reinstall the libzip distribution
  • autoconf
    • Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

ほか

  • WARNING: unrecognized options: --with-mcrypt が出たら
  • WARNING: Use of bundled libzip is deprecated and will be removed. Some features such as encryption and bzip2 are not available. Use system library and --with-libzip is recommended. が出たら
    • ~/.anyenv/envs/phpenv/plugins/php-build/share/php-build/default_configure_options--with-libzip の記述を追記する

ほか、エラー吐く前に他所を参照して入れてしまったりしたもの一覧

  • libpng3