Text 7 Jul 4 notes Installing php + phing in MacOsX with Brew

How to install PHP with Brew Grab the latest copy of my PHP brew and copy it into your Homebrew Formula directory. The formula isn’t added by default.

curl -O https://github.com/ampt/homebrew/raw/php/Library/Formula/php.rb
mv php.rb `brew --prefix`/Library/Formula
Install php with brew
brew install php --with-apache --with-mysql
The default location of mysql.sock is in the /tmp/mysql.sock directory. We’ll need to change this to /var/mysql/mysql.sock as this is where PHP will look for it. So first off, create a my.conf (or in this case my.cnf) file in your text editor and save it as my.cnf in the /etc folder with the following code:
[client]
socket = /var/mysql/mysql.sock
 
[mysqld]
socket = /var/mysql/mysql.sock
Next move mysql.sock to it’s new directory by typing the following code in a Terminal window:
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
Add to .bash_profile:
echo 'export PATH='`brew --prefix php`'/bin:$PATH' >> .bash_profile
To enable PHP in Apache add the following to httpd.conf and restart Apache:
 LoadModule php5_module    /usr/local/Cellar/php/5.3.5/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/Cellar/php/5.3.5/etc/php.ini
Second step is to install phing: 1: Go to the correct folder (with Brew)
cd /usr/local/Cellar/php/5.3.5/bin
2: Make sure pear can locate the package:
./pear channel-discover pear.phing.info
3: Install phing:
./pear install phing/phing
—— And that’s all! If you want set phing in your path, you should add the following lines in your ~/.bash_profile
$ export PHP_COMMAND=/usr/local/Cellar/php/5.3.5/bin
$ export PHING_HOME=/usr/local/Cellar/php/5.3.5/bin
$ export PHP_CLASSPATH=${PHING_HOME}/classes
$ export PATH=${PATH}:${PHING_HOME}
Thanks to the following sources and interesting resources: http://notfornoone.com/2010/07/install-php53-homebrew-snow-leopard/ http://www.torkiljohnsen.com/2009/04/06/installing-phing-on-mamp-mac-osx/ http://phing.info/docs/guide/current/ http://superfancy.net/coding/php-mysql-apache-in-mac-osx-leopard/

  1. rabarroso posted this

Design crafted by Prashanth Kamalakanthan. Powered by Tumblr.