Skip to content

Building PHP Versions

Wil Moore III edited this page Aug 5, 2014 · 6 revisions

Homebrew PHP (recommended for Mac OSX users)

% brew tap josegonzalez/homebrew-php
% install php56 --without-pear --without-apache --with-pgsql --with-fpm --with-intl --with-gmp --with-homebrew-curl --with-homebrew-openssl --with-homebrew-libxslt --with-imap --with-pgsql || true
% install php56-intl || true
% unlink php56 || true

PHP Build (recommended for *nix Users)

SEE: https://github.com/CHH/php-build for further details

Do It Yourself (recommended for those that need more control)

% PHP_TARGET_VERSION=5.5.3
% PHP_INSTALL_PREFIX=$HOME/.phps
% mkdir -p /tmp/src/php-$PHP_TARGET_VERSION
% cd /tmp/src/php-$PHP_TARGET_VERSION
% curl -# -L http://downloads.php.net/stas/php-$PHP_TARGET_VERSION.tar.gz | tar -xz --strip 1
% ./configure \
            --sysconfdir=/private/etc \
            --prefix=$PHP_INSTALL_PREFIX/$PHP_TARGET_VERSION \
            --with-config-file-path=$PHP_INSTALL_PREFIX/$PHP_TARGET_VERSION/etc \
            --mandir=$PHP_INSTALL_PREFIX/$PHP_TARGET_VERSION/share/man \
            --disable-debug \
            --enable-bcmath \
            --enable-calendar \
            --enable-cli \
            --enable-exif \
            --enable-fpm \
            --enable-ftp \
            --enable-gd-native-ttf \
            --enable-libxml \
            --enable-mbstring \
            --enable-mbregex \
            --enable-pcntl \
            --enable-shmop \
            --enable-soap \
            --enable-sockets \
            --enable-sysvmsg \
            --enable-sysvsem \
            --enable-sysvshm \
            --enable-wddx \
            --enable-zip \
            --with-bz2=/usr \
            --with-curl=/usr \
            --with-freetype-dir=/opt/local \
            --with-gd \
            --with-gettext \
            --with-iconv \
            --with-iodbc \
            --with-jpeg-dir=/usr \
            --with-kerberos=/usr \
            --with-ldap \
            --with-ldap-sasl=/usr \
            --with-libxml-dir=/usr/local \
            --with-mcrypt=/usr/local \
            --with-mysqli=mysqlnd \
            --with-openssl=/usr \
            --with-pdo-mysql=mysqlnd \
            --with-pdo-sqlite \
            --with-png-dir=/usr \
            --with-sqlite3 \
            --with-tidy \
            --with-xmlrpc \
            --with-xsl=/usr \
            --with-zlib=/usr \
            --without-pear \