Add PHPUnit to MAMP 2.x, including PHP 5.4.4 for OSX 10.8

December 3rd, 2012 0 Comments

delete: /Applications/MAMP/bin/php/php5.4.4/conf/pear.conf
(delete or bak)

$ /Applications/MAMP/bin/php/php5.4.4/bin/pear channel-update
$ /Applications/MAMP/bin/php/php5.4.4/bin/pear upgrade pear
$ /Applications/MAMP/bin/php/php5.4.4/bin/pear channel-discover
$ /Applications/MAMP/bin/php/php5.4.4/bin/pear channel-discover
$ /Applications/MAMP/bin/php/php5.4.4/bin/pear install phpunit/PHPUnit

make available in terminal:
$ mv /Applications/MAMP/bin/php/php5.4.4/bin/phpunit /usr/local/bin/phpunit

type phpunit –version in Terminal
(you will see latest version of PHPUnit).

Note, if you need an older version of PHPUnit, like 3.6.x, you will indicate that when installing phpunit/PHPUnit-3.6.12

How to install PHPUnit on Mac OSX

October 18th, 2012 0 Comments

The de facto standard unit testing framework for PHP is PHPUnit. You can find it here (GitHub repository). Even if the documentation explains how to install it on your system, it may not be as self-explanatory as it looks. Here is a little how-to for Mac OSX.

Open a Terminal window and type :

curl > go-pear.phar
This will copy the file we need to install PEAR on your local hard drive, in your User directory.

Install PEAR.
Still in Terminal, type :

sudo php go-pear.phar
Change the installation path (option 1) to

and launch installation.
After installation has completed, you can safely delete the go-pear.phar file.

Tell PHP CLI where PEAR is.
By default, PHP CLI (Command Line Interface) php.ini does not exist, but a template is available on the system. We have to copy and edit it. Type :

sudo cp /etc/php.ini.default /etc/php.ini
sudo nano /etc/php.ini
Uncomment the include_path line and make it look like this :

include_path = “.:/usr/local/share/pear”
Tell Terminal where PEAR is.
To let Terminal know where is your PEAR path and be able to launch PHPUnit right from the console, type (in the console) :

sudo nano /etc/profile
and add

export PATH=$PATH:/usr/local/bin
to the end of the file.
Save and exit. Close your Terminal window.

Install PHPUnit.
Open a new Terminal window and type :
sudo pear config-set auto_discover 1
sudo pear install
This will install all needed files for PHPUnit to run.

Everything should be fine. In your Terminal, type :
You should get a list of all available PHPUnit functions. Happy testing !

Setup Xdebug with Zend Server CE

January 20th, 2012 0 Comments

Open Zend Server page, http://localhost:10081/

Disable “Zend Debugger”

Download binary which I suggest to download at ->

Extract the archive and browse into ’5.3′ folder then copy ‘’ to ‘/usr/local/zend/lib/php_extensions’

Open ‘/usr/local/zend/etc/php.ini’ and add the following lines above [zend] section:


Now restart your Zend Server by ‘sudo /usr/local/zend/bin/ stop’ and ‘sudo /usr/local/zend/bin/ start’