Skip to content

Instantly share code, notes, and snippets.

@loranger
Created April 2, 2015 10:21
Show Gist options
  • Save loranger/608b9109c23df527de77 to your computer and use it in GitHub Desktop.
Save loranger/608b9109c23df527de77 to your computer and use it in GitHub Desktop.
brew info php56
php56: stable 5.6.7 (bottled), HEAD
https://php.net
/usr/local/Cellar/php56/5.6.7 (330 files, 66M) *
Built from source with: --with-mssql, --with-homebrew-curl, --with-imap, --without-pear, --with-phpdbg, --with-thread-safety, --with-homebrew-libxslt, --with-tidy
From: https://github.com/josegonzalez/homebrew-php/blob/master/Formula/php56.rb
==> Dependencies
Required: freetype ✔, gettext ✔, homebrew/dupes/zlib ✔, icu4c ✔, jpeg ✔, libpng ✔, openssl ✔, unixodbc ✔
Optional: enchant ✘, gmp ✔
==> Options
--homebrew-apxs
Build against apxs in Homebrew prefix
--with-cgi
Enable building of the CGI executable (implies --without-fpm)
--with-debug
Compile with debugging symbols
--with-enchant
Build with enchant support
--with-gmp
Build with gmp support
--with-homebrew-curl
Include Curl support via Homebrew
--with-homebrew-libxslt
Include LibXSLT support via Homebrew
--with-imap
Include IMAP extension
--with-libmysql
Include (old-style) libmysql support instead of mysqlnd
--with-mssql
Include MSSQL-DB support
--with-pdo-oci
Include Oracle databases (requries ORACLE_HOME be set)
--with-phpdbg
Enable building of the phpdbg SAPI executable (PHP 5.4 and above)
--with-postgresql
Build with postgresql support
--with-snmp
Build with SNMP support
--with-thread-safety
Build with thread safety
--with-tidy
Include Tidy support
--without-apache
Disable building of shared Apache 2.0 Handler module
--without-bz2
Build without bz2 support
--without-fpm
Disable building of the fpm SAPI executable
--without-ldap
Build without LDAP support
--without-mysql
Remove MySQL/MariaDB support
--without-pcntl
Build without Process Control support
--without-pear
Build without PEAR
--HEAD
Install HEAD version
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php/5.6/php.ini
✩✩✩✩ PEAR ✩✩✩✩
If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
chmod -R ug+w /usr/local/Cellar/php56/5.6.7/lib/php
pear config-set php_ini /usr/local/etc/php/5.6/php.ini system
✩✩✩✩ Extensions ✩✩✩✩
If you are having issues with custom extension compiling, ensure that
you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:
PATH="/usr/local/bin:$PATH"
PHP56 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.
✩✩✩✩ PHP CLI ✩✩✩✩
If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
~/.zshrc, ~/.profile or your shell's equivalent configuration file:
export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"
✩✩✩✩ FPM ✩✩✩✩
To launch php-fpm on startup:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
The control script is located at /usr/local/opt/php56/sbin/php56-fpm
OS X 10.8 and newer come 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 'homebrew-php.josegonzalez.php56.plist' in old versions
of this formula.
To have launchd start php56 at login:
ln -sfv /usr/local/opt/php56/*.plist ~/Library/LaunchAgents
Then to load php56 now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment