LoginSignup
4
3

More than 5 years have passed since last update.

Macにphp 7.0.3をphpenvでインストールした時のメモ

Posted at

phpenvインストールはこちらをどうぞ

phpenvだけ入った状態でphp7をインストールしようとすると

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

Here are the last 10 lines from the log:

-----------------------------------------
2 warnings generated.
/var/tmp/php-build/source/7.0.3/ext/zip/lib/mkstemp.c:75:8: warning: implicit declaration of function 'getpid' is invalid in C99 [-Wimplicit-function-declaration]
        pid = getpid();
              ^
1 warning generated.
/var/tmp/php-build/source/7.0.3/Zend/zend.c:1292:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^
1 warning generated.
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
-----------------------------------------

というようなエラーが表示されます。
php7インストールに必要なパッケージがないためなので、すべてインストールします。

$ brew install bison
$ brew install re2c
$ brew install libjpeg
$ brew install libpng
$ brew install libmcrypt
$ brew install autoconf

その後インストールします。

$ phpenv install 7.0.3
[Success]: Built 7.0.3 successfully.

すんなり入りました。

opensslのエラーが発生する場合はこちらもご参照ください。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3