Skip to content

Instantly share code, notes, and snippets.

@Jaesin
Last active August 29, 2015 14:20
Show Gist options
  • Save Jaesin/9e1bde217480659d3cf2 to your computer and use it in GitHub Desktop.
Save Jaesin/9e1bde217480659d3cf2 to your computer and use it in GitHub Desktop.
Install php 7 in /usr/local/builds/php/7.x in OSX 10.10.3
#!/bin/bash
# The easy version is `curl -s http://php-osx.liip.ch/install.sh | bash -s 7.0`
# It might be better to use (build-entropy-php)[https://github.com/liip/build-entropy-php] for building.
# Create the destinaiton folder.
mkdir -p /usr/local/builds/php
# Clone the php source (Just using the master branch).
git clone https://git.php.net/repository/php-src.git /usr/local/builds/php/7.x
# Install the right version of bison.
cd ../
git checkout adf87c6 /usr/local/Library/Formula/bison.rb
# I had an error first time I tried to install bison. This fixed it.
# @source: https://github.com/Homebrew/homebrew/issues/39170#issuecomment-97367623
sudo chmod +t /private/tmp/
# @source: https://github.com/phpenv/phpenv/issues/37#issuecomment-26000510
brew install bison
brew switch bison 2.7
brew link bison --force
sudo mv /usr/bin/bison /usr/bin/bison.orig
sudo ln -s /usr/local/bin/bison /usr/bin/bison
# Restor the original file
git checkout /usr/local/Library/Formula/bison.rb
cd 7.x
# install dependencies
brew install aspell
brew install recode
./buildconf
./configure \
--prefix=/usr/local/builds/php/7.x/build/debug \
--with-config-file-path=/usr/local/builds/php/7.x/build/etc \
--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-mcrypt \
--with-iconv \
--with-gmp \
--with-pspell \
# --with-gd \
# --enable-gd-native-ttf=no \
# --enable-gd-jis-conv=no \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--with-t1lib=/usr \
--with-openssl \
--with-pdo-mysql=/usr/local/bin/mysql \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-mysqli=/usr/local/bin/mysql_config \
--with-gettext=/usr/local/opt/gettext
make
# make test
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment