1. Install depends PHP 7.0
$ brew install autoconf automake gmp homebrew/versions/bison27 gd freetype t1lib gettext zlib mcrypt
$ git clone --depth=1 https://github.com/php/php-src.git
$ cd php-src
$ ./buildconf
$ env YACC=`brew --prefix bison27`/bin/bison ./configure \
--prefix="/usr/local/opt/php7" \
--with-config-file-path="/usr/local/etc/php7" \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-curl \
--with-iconv \
--with-gmp \
--with-gd \
--with-jpeg-dir=`brew --prefix gd` \
--with-png-dir=`brew --prefix gd` \
--with-freetype-dir=`brew --prefix freetype` \
--with-t1lib=`brew --prefix t1lib` \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/tmp/mysql.sock \
--with-gettext=`brew --prefix gettext` \
--with-zlib=`brew --prefix zlib` \
--with-bz2 \
--with-mcrypt=`brew --prefix mcrypt`
$ make -j `sysctl -n hw.logicalcpu_max`
$ open -R .
Optional. Deploy OSX package (First step 2 finish)
$ env INSTALL_ROOT=$PWD/php7-pkg make install
$ pkgbuild \
--root php7-pkg \
--identifier org.denji.php7 \
--version 7.0.0 \
--ownership recommended \
PHP-7.0.0.pkg
$ open -R PHP-7.0.0.pkg
Install PHP 7.0 to /usr/local/opt/php7
$ make install
$ rm -rvf "/usr/local/opt/php7"
$ rm -rvf "/usr/local/etc/php7"
export php.ini-{development,production}
, php-fpm.ini
, extensions ini
, php.ini
, fpm srcipt launchd
in /usr/local/etc/php7/
if you don't find formula with
brew install bison27
then you need try thisbrew install homebrew/versions/bison27