Homebrew formulas for my personal PHP development.
Tap
$ brew tap markwu/homebrew-php
Currently, I only support phpbrew, composer and ctags-better-php.
$ brew install phpbrew
$ brew link --force icu4c
$ brew install composer
$ brew install ctags-better-php
It also supports phpbrew & composer's self-update
command, you can update them by
$ phpbrew self-update
$ composer self-update
Before using it, please run phpbrew init
.
And also add the following command to your bash/zshrc source ~/.phpbrew/bashrc
.
Now, you can brew your own php. Take php 5.5.17 for examples:
$ phpbrew install 5.5.17 +default +mysql +gettext=/usr/local/opt/gettext +iconv +ftp +exif +dba +openssl +soap +apxs2=/usr/local/bin/apxs
$ phpbrew switch 5.5.17
$ phpbrew ext install gd
$ phpbrew ext install opcache
By default, homebrew will download formula from bottle (A precompiled binary library) if available. But If you ecounter php-gd errors in compile or execution time. Especially after your upgrade your xcode. Try the following snippets.
$ phpberw rm gd fontconfig freetype jpeg libpng libtiff xz
$ phpbrew install gd --build-from-source