Last Updated: 01 Nov 2023

   |   

Author: 114.119.156.55

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
server-tech:macosx:installing-phpunit-on-mamp [Mar 14, 2013 07:34 AM]
dordal
server-tech:macosx:installing-phpunit-on-mamp [Nov 21, 2020 10:39 PM]
127.0.0.1 external edit
Line 1: Line 1:
 += Installing PHPUnit on MAMP =
  
 +Installing [[http://www.phpunit.de/manual/current/en/index.html|PHPUnit]] under [[http://www.mamp.info/|MAMP]] can be a bit of a hassle. Here's what I did to install phpunit 3.6.11 under MAMP Pro 2.0.5.
 +
 +  * MAMP, as you may know, has its own versions of PHP, PEAR, etc. These aren't related to the versions that Apple provides with OS X. MAMP's copies of these binaries live at ''/Applications/MAMP/bin/php/php5.2.17/bin''. You'll want to install your PHPUnit there.
 +  * For some reason, there's an old config file that MAMP chokes on. At least there was on my install: '' mv /Applications/MAMP/bin/php/php5.2.17/conf/pear.conf /Applications/MAMP/bin/php/php5.2.17/conf/pear.conf.bak''
 +  * First, you'll probably need to update PEAR:<code>
 +/Applications/MAMP/bin/php/php5.2.17/bin/pear channel-update pear.php.net
 +/Applications/MAMP/bin/php/php5.2.17/bin/pear upgrade pear
 +</code> This should upgrade you to PEAR 1.9.4, or possibly a newer version.
 +  * Now it's time to add the appropriate PEAR channels for PHPUnit:<code>
 +/Applications/MAMP/bin/php/php5.2.17/bin/pear channel-discover pear.phpunit.de
 +/Applications/MAMP/bin/php/php5.2.17/bin/pear channel-discover pear.symfony.com
 +/Applications/MAMP/bin/php/php5.2.17/bin/pear channel-discover components.ez.no
 +</code>
 +  * Finally, install PHPUnit:<code>
 +/Applications/MAMP/bin/php/php5.2.17/bin/pear install phpunit/PHPUnit
 +</code>
 +  * Test phpunit to make sure it was installed correctly:<code> /Applications/MAMP/bin/php/php5.2.17/bin/phpunit --version
 +</code>
 +  * Technically, you're done now. However, its a real pain to access PHPunit by typing its full path, so I like to symlink it to ''phpunit'' in my path:<code>
 +sudo ln -s /Applications/MAMP/bin/php/php5.2.17/bin/phpunit /usr/local/bin/phpunit</code>
 +
 +That's it! If you have any questions or suggestions for improvements, post in the comments.