さんごー日記。

映画や本やゲームの感想をゆるく記録したり、プログラミングの勉強をゆるく記録するゆるい日記です。

phpenvでphpをインストールする時のエラー対処

phpenvを使ってphpをインストールしようとしたらエラーが出まくったのでメモしておく。

configure: error: Please reinstall the BZip2 distribution

$ env install 7.1.0

(略)

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: WARNING: unrecognized options: --enable-phpdbg
configure: WARNING: bison versions supported for regeneration of the Zend/PHP parsers: 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7 (found: none).
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
configure: error: Please reinstall the BZip2 distribution
-----------------------------------------

bzip2-develをインストールすればOK。

sudo yum install bzip2-devel

Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.

$ env install 7.1.0

(略)

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: ).
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
-----------------------------------------

libicu-develをインストールすればOK。

sudo yum install libicu-devel

C++ preprocessor "/lib/cpp" fails sanity check

$ phpenv install 7.1.0

(略)

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: ).
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
configure: error: in `/tmp/php-build/source/7.1.0':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
-----------------------------------------

gcc-c++をインストールすればOK。

sudo yum install gcc-c++

You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.

$ phpenv install 7.1.0

(略)

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: ).
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
configure: error: Cannot find libtidy
-----------------------------------------

re2cをインストールすればOK。

sudo yum install re2c

libtidy

$ phpenv install 7.1.0

(略)

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: none, min: 204, excluded: ).
configure: error: Cannot find libtidy
-----------------------------------------

ふつうにyumでlibtidyをインストールしようとしたらエラーになった。

sudo yum install libtidy

ぐぐって調べた通りにリポジトリを変えてみたり、php-tidyを入れようとしてもダメ。
今の所未解決。