Skip to content

Instantly share code, notes, and snippets.

@DragonBe
Created November 12, 2016 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DragonBe/8af00f141ed55890465ec9ae8c804f6d to your computer and use it in GitHub Desktop.
Save DragonBe/8af00f141ed55890465ec9ae8c804f6d to your computer and use it in GitHub Desktop.
A quick configure script for building PHP
#!/bin/sh
PHP=$1
if [ $# -lt 1 ]
then
echo "Usage: $0 <php-version>"
echo
echo "php-version: php7 $PHP"
echo
exit 1
fi
echo "Installation of PHP in /opt/$PHP with config in /etc/$PHP"
LIBDIR=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr
#LIBDIR=/usr
CC=gcc ./configure \
--prefix=/opt/$PHP \
--enable-cli \
--enable-sockets \
--enable-zip \
--enable-exif \
--enable-gd-jis-conv \
--enable-gd-native-ttf \
--enable-ftp \
--enable-soap \
--enable-mbstring \
--without-iconv \
--with-config-file-path=/etc/$PHP \
--with-config-file-scan-dir=/etc/$PHP/ext \
--with-curl \
--with-apxs2=/usr/sbin/apxs \
--with-libxml-dir=$LIBDIR \
--with-libedit=$LIBDIR \
--with-zlib=$LIBDIR \
--with-gd \
--with-png-dir=$LIBDIR \
--with-jpeg-dir=$LIBDIR \
--with-openssl=/usr/local \
--with-mysqli \
--with-pdo-mysql \
--with-mysql-sock=/tmp/mysql.sock
#--enable-intl \
#--with-iconv-dir=$LIBDIR/lib \
#--with-mcrypt=$LIBDIR/bin \
#--with-openssl=$LIBDIR/ssl \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment