Skip to content

Instantly share code, notes, and snippets.

@memoryleak
Last active March 4, 2016 14:23
Show Gist options
  • Select an option

  • Save memoryleak/e659d66820b22c194227 to your computer and use it in GitHub Desktop.

Select an option

Save memoryleak/e659d66820b22c194227 to your computer and use it in GitHub Desktop.
Build PHP on Mac
#!/bin/bash
#
# Successfully build php-5.5.24 on Yosemite 10.10.3 (14D131) with following libraries / application installed via brew:
# autoconf
# automake
# fontconfig
# freetype
# gd
# icu4c
# imagemagick
# jpeg
# libpng
# libtiff
# libtool
# mcrypt
# mhash
# openssl
# pcre
# pkg-config
# readline
# @TODO: ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr /usr/include
# @TODO: sudo ln -s /usr/local/Cellar/icu4c/55.1/bin/icu-config /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/bin/icu-config
export LC_CTYPE=C
export LANG=C
make clean
./configure \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--prefix=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--sysconfdir=/private/etc \
--disable-cgi \
--enable-cli \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--enable-intl \
--enable-mbstring \
--enable-embedded-mysqli \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--enable-zip \
--enable-mysqlnd \
--with-apxs2=/usr/sbin/apxs \
--with-bz2=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/Library/Server/Web/Config/php \
--with-curl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-gd \
--with-icu-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-94~2/Root/usr/local \
--with-freetype-dir=/usr \
--with-kerberos=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-ldap-sasl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-ldap=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-libedit=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-libxml-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-mysql-sock=/var/mysql/mysql.sock \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-ndbm=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-openssl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-pcre-regex \
--with-pdo-mysql=mysqlnd \
--with-readline=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-snmp=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-xmlrpc \
--with-xsl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-zlib-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-pear \
--with-iconv=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr \
--with-iconv-dir=/Users/chhaci/Downloads/libiconv-1.14 \
--with-mcrypt
if [ $? -eq 0 ]; then
make
fi
#!/bin/bash
# Successfully build php-5.5.24 on Yosemite 10.10.3 (14D131) with following libraries / application installed via brew:
# autoconf
# automake
# fontconfig
# freetype
# gd
# icu4c
# imagemagick
# jpeg
# libpng
# libtiff
# libtool
# mcrypt
# mhash
# openssl
# pcre
# pkg-config
# readline
# @TODO: Download and extract http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz to ~/Downloads
# @TODO: cd /usr/include; ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl
# @TODO: sudo ln -s /usr/local/Cellar/icu4c/56.1/bin/icu-config /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/bin/icu-config
export LC_CTYPE=C
export LANG=C
make clean
./configure \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--prefix=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--sysconfdir=/private/etc \
--disable-cgi \
--enable-cli \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--enable-intl \
--enable-mbstring \
--enable-embedded-mysqli \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--enable-zip \
--enable-mysqlnd \
--with-apxs2=/usr/sbin/apxs \
--with-bz2=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/Library/Server/Web/Config/php \
--with-curl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-gd \
--with-icu-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-94~2/Root/usr/local \
--with-freetype-dir=/usr \
--with-kerberos=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-ldap-sasl \
--with-ldap \
--with-libedit=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-libxml-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-mysql-sock=/var/mysql/mysql.sock \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-ndbm=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql=mysqlnd \
--with-readline=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-snmp=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-xmlrpc \
--with-xsl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-zlib-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr \
--with-pear \
--with-iconv=/Users/hciftci/Downloads/libiconv-1.14 \
--with-mcrypt
if [ $? -eq 0 ]; then
make
fi
#!/bin/bash
#brew install openssl enchant webp gettext icu4c jpeg libpng pcre mcrypt mhash recode libzip
./configure \
--enable-bcmath \
--enable-calendar \
--enable-cli \
--enable-exif \
--enable-ftp \
--enable-gd-jis-conv \
--enable-gd-native-ttf \
--enable-intl \
--enable-mbstring \
--enable-mysqlnd \
--enable-pcntl \
--enable-phpdbg \
--enable-phpdbg-debug \
--enable-phpdbg-webhelper \
--enable-re2c-cgoto \
--enable-soap \
--enable-sockets \
--enable-zend-signals \
--enable-zip \
--infodir=/usr/share/info \
--mandir=/usr/share/man \
--prefix=/usr \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--with-bz2 \
--with-config-file-path=/etc \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-config-file-scan-dir=/Library/Server/Web/Config/php \
--with-curl \
--with-enchant=/usr/local/Cellar/enchant/1.6.0 \
--with-gd \
--with-gettext=/usr/local/Cellar/gettext/0.19.7 \
--with-iconv-dir \
--with-iconv=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.Internal.sdk/usr \
--with-icu-dir=/usr/local/Cellar/icu4c/56.1 \
--with-jpeg-dir=/usr/local/Cellar/jpeg/8d \
--with-ldap \
--with-libdir=lib \
--with-libedit \
--with-libexpat-dir \
--with-libmbfl \
--with-libxml-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.Internal.sdk/usr \
--with-libzip=/usr/local/Cellar/libzip/1.1 \
--with-mcrypt=/usr/local/Cellar/mcrypt/2.6.8 \
--with-mhash=/usr/local/Cellar/mhash/0.9.9.9 \
--with-mysql-sock=/tmp/mysql.sock \
--with-openssl=/usr/local/Cellar/openssl/1.0.2g \
--with-pcre-regex=/usr/local/Cellar/pcre/8.38 \
--with-pdo-mysql \
--with-pdo-pgsql \
--with-pear \
--with-pgsql=/usr/local/postgresql/include \
--with-png-dir=/usr/local/Cellar/libpng/1.6.21 \
--with-pspell \
--with-readline \
--with-recode \
--with-snmp \
--with-webp-dir=/usr/local/Cellar/webp/0.5.0 \
--with-xmlrpc \
--with-xsl \
--with-zlib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment