Skip to content

Instantly share code, notes, and snippets.

@diego-carrera
Created October 2, 2012 18:00
Show Gist options
  • Save diego-carrera/3821761 to your computer and use it in GitHub Desktop.
Save diego-carrera/3821761 to your computer and use it in GitHub Desktop.
brew install -V php53 --with-fpm --with-mysql --with-intl
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libmacfuse_i32.2.dylib /usr/local/lib/libmacfuse_i64.2.dylib /usr/local/lib/libosxfuse_i32.2.dylib /usr/local/lib/libosxfuse_i64.2.dylib /usr/local/lib/libusb-0.1.4.dylib /usr/local/lib/libusbpp-0.1.4.dylib
Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .la files:
/usr/local/lib/libosxfuse_i32.la /usr/local/lib/libosxfuse_i64.la /usr/local/lib/libusb.la /usr/local/lib/libusbpp.la
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .pc files:
/usr/local/lib/pkgconfig/libusb.pc /usr/local/lib/pkgconfig/osxfuse.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libusb.a /usr/local/lib/libusbpp.a
Warning: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.
==> Downloading http://www.php.net/get/php-5.3.17.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php53-5.3.17
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
of homebrew-php, or you are using a non-standard
pear.conf location, installation may fail.
==> ./configure --prefix=/usr/local/Cellar/php53/5.3.17 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.3 --with-config-file-path=/usr/local/etc/php/5.3 --with-config-file-scan-dir=/usr/local/etc/php/5.3/conf.d --with-iconv-dir=/usr --enable-dba --with-ndbm=/usr --enable-exif --enable-soap --enable-sqlite-utf8 --enable-wddx --enable-ftp --enable-sockets --enable-zip --enable-pcntl --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-mbstring --enable-mbregex --enable-zend-multibyte --enable-bcmath --enable-calendar --with-zlib=/usr/local/Cellar/zlib/1.2.7 --with-ldap --with-ldap-sasl=/usr --with-xmlrpc --with-kerberos=/usr --with-xsl=/usr --with-curl=/usr/local/Cellar/curl/7.27.0 --with-gd --enable-gd-native-ttf --with-freetype-dir=/usr/local/Cellar/freetype/2.4.10 --with-mcrypt=/usr/local/Cellar/mcrypt/2.5.8 --with-jpeg-dir=/usr/local/Cellar/jpeg/8d --with-png-dir=/usr/local/Cellar/libpng/1.5.13 --with-gettext=/usr/local/Cellar/gettext/0.18.1.1 --with-snmp=/usr --with-mhash --with-libedit --mandir=/usr/local/Cellar/php53/5.3.17/share/man --with-bz2=/usr --with-openssl=/usr --enable-fpm --with-fpm-user=_www --with-fpm-group=_www --enable-intl --with-icu-dir=/usr/local/Cellar/icu4c/49.1.2 --with-mysql-sock=/tmp/mysql.sock --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-iodbc --with-pdo-odbc=generic,/usr,iodbc
Warning: inreplace in 'Makefile' failed
Expected replacement of 'INSTALL_IT = $(mkinstalldirs) '$(INSTALL_ROOT)/usr/libexec/apache2' && $(mkinstalldirs) '$(INSTALL_ROOT)/private/etc/apache2' && /usr/sbin/apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/libexec/apache2' -S SYSCONFDIR='$(INSTALL_ROOT)/private/etc/apache2' -i -a -n php5 libs/libphp5.so' with 'INSTALL_IT = $(mkinstalldirs) '/usr/local/Cellar/php53/5.3.17/libexec/apache2' && $(mkinstalldirs) '$(INSTALL_ROOT)/private/etc/apache2' && /usr/sbin/apxs -S LIBEXECDIR='/usr/local/Cellar/php53/5.3.17/libexec/apache2' -S SYSCONFDIR='$(INSTALL_ROOT)/private/etc/apache2' -i -a -n php5 libs/libphp5.so'
==> make
==> make install
==> /usr/local/Cellar/php53/5.3.17/bin/pear config-set php_ini /usr/local/etc/php/5.3/php.ini
==> Caveats
For 10.5 and Apache:
Apache needs to run in 32-bit mode. You can either force Apache to start
in 32-bit mode or you can thin the Apache executable.
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/Cellar/php53/5.3.17/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php/5.3/php.ini
✩✩✩✩ PEAR ✩✩✩✩
If pear complains about permissions, 'Fix' the default PEAR permissions and config:
chmod -R ug+w /usr/local/Cellar/php53/5.3.17/lib/php
pear config-set php_ini /usr/local/etc/php/5.3/php.ini
✩✩✩✩ Extensions ✩✩✩✩
If you are having issues with custom extension compiling, ensure that this php is
in your PATH:
PATH="$(brew --prefix josegonzalez/php/php53)/bin:$PATH"
Extensions will never be compiled against this homebrew-php PHP. Please install them
using --with-homebrew-php to enable compiling against this php.
✩✩✩✩ FPM ✩✩✩✩
If you have installed the formula with --with-fpm, to launch php-fpm on startup:
* If this is your first install:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/php53/5.3.17/homebrew-php.josegonzalez.php53.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php53.plist
* If this is an upgrade and you already have the homebrew-php.josegonzalez.php53.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php53.plist
cp /usr/local/Cellar/php53/5.3.17/homebrew-php.josegonzalez.php53.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php53.plist
Mountain Lion comes with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:
PATH="/usr/local/sbin:$PATH"
You may also need to edit the plist to use the correct "UserName".
Please note that the plist was called 'org.php-fpm.plist' in old versions
of this formula.
==> Summary
/usr/local/Cellar/php53/5.3.17: 481 files, 28M, built in 3.4 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment