Skip to content

Instantly share code, notes, and snippets.

@keyvanakbary
Forked from denji/readme-php7.md
Created January 20, 2016 13:24
Show Gist options
  • Save keyvanakbary/da99f940a18996a64921 to your computer and use it in GitHub Desktop.
Save keyvanakbary/da99f940a18996a64921 to your computer and use it in GitHub Desktop.

Quick install PHP 7.0:

1. Install depends PHP 7.0
$ brew install autoconf automake gmp homebrew/versions/bison27 gd freetype t1lib gettext zlib mcrypt
2. Configure PHP 7.0
$ 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

Uninstall PHP 7.0

$ rm -rvf "/usr/local/opt/php7"
$ rm -rvf "/usr/local/etc/php7"

TODO

  1. export php.ini-{development,production}, php-fpm.ini, extensions ini, php.ini, fpm srcipt launchd in /usr/local/etc/php7/

Links

2014-09-26 10 36 56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment