• 15th, Apr 2011

Installing Zend + PHPUnit on Mac OS x with MAMP

1) Replacing MAC OS X php and pear for MAMP

cd /Applications/MAMP/bin/php5.3/bin
sudo chmod 0554 *

cd /usr/bin
sudo mv php php.bak
sudo ln -s /Applications/MAMP/bin/php5.3/bin/php php
sudo mv pear pear.bak
sudo ln -s /Applications/MAMP/bin/php5.3/bin/pear pear
cd /etc
sudo ln -s /Applications/MAMP/conf/php5.3/php.ini /etc/php.ini

vi .bash_login
PATH=$PATH:/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php5.3/bin

logout

** Before MAMP 2.x **
cd /Applications/MAMP/bin/php5.3/bin
pear config-set
Note: If you get "error: Notice: unserialize(): Error at offset 276 of 1133 bytes in Config.php on line 1050" then just delete /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf before proceeding. You are on MAMP 2.x!

pear config-set doc_dir /Applications/MAMP/bin/php5.3/lib/php/doc
pear config-set ext_dir /Applications/MAMP/bin/php5.3/lib/php/extensions
pear config-set php_dir /Applications/MAMP/bin/php5.3/lib/php/PEAR
pear config-set php_bin /Applications/MAMP/bin/php5.3/bin/php
pear config-set php_ini /Applications/MAMP/conf/php5.3/php.ini/
pear config-set sig_keydir /Applications/MAMP/conf/php5.3/pearkeys
** end Before MAMP 2.x **

** MAMP 2.x **
cd /Applications/MAMP/bin/php/php5.3.6/bin
pear config-set doc_dir /Applications/MAMP/bin/php/php5.3.6/lib/php/doc
pear config-set ext_dir /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions
pear config-set php_dir /Applications/MAMP/bin/php/php5.3.6/
pear config-set php_bin /Applications/MAMP/bin/php/php5.3.6/bin/php
pear config-set php_ini /Applications/MAMP/bin/php/php5.3.6/conf/php.ini
** end MAMP 2.x **

pear channel-update pear.php.net

pear upgrade pear

pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear install phpunit/PHPUnit

** Before MAMP 2.x **
vi /Applications/MAMP/conf/php5.3/php.ini
include_path = ".:/Applications/MAMP/bin/php5.3/lib/php:/Applications/MAMP/bin/php5.3/lib/php/PEAR"
** end Before MAMP 2.x **

** MAMP 2.x **
vi /Applications/MAMP/bin/php/php5.3.6/conf/php.ini
include_path = ".:/Applications/MAMP/bin/php/php5.3.6/lib/php:/Applications/MAMP/bin/php/php5.3.6/"
** end MAMP 2.x **


2) Install Zend Framework

# Download Zend Framework to your Downloads folder
cd
mv Downloads/ZendFramework-1.11.5 /Applications/MAMP/bin/php5.3/lib/php/
cd /Applications/MAMP/bin/php5.3/lib/php/
ln -s ZendFramework-1.11.5 Zend



3) Create a link to the zf.sh tool

vi ~/.bash_login
alias zf=/Applications/MAMP/bin/php5.3/lib/php/Zend/bin/zf.sh
Error: Testing Note: PHPUnit was not found in your include_path, therefore no testing actions will be created.
Solution: Make sure you’ve installed PHPUnit from https://github.com/sebastianbergmann/phpunit/ instead of http://phpunit.sourceforge.net/
 
Error: phpunit/PHPUnit requires PEAR Installer (version >= x.x.x), installed version is x.x.x
Solution: try with an older PHPUnit version: pear install phpunit/PHPUnit-3.3.17
  • MAC OS X 10.6.6
  • MAMP 1.9.2
  • Zend Framework 1.11.5
  • PHPUnit 3.3.17

Click here to submit your review.


Submit your review
* Required Field

TAGS: None

3 Responses to “Installing Zend + PHPUnit on Mac OS x with MAMP”


  1. marsch
    on Apr 28th, 2011
    @ 6:22 am

    good!
    thx~


  2. Nick
    on May 12th, 2011
    @ 2:02 pm

    Thanks!!!!!!!! I’ve been looking everywhere for a concrete/up to date answer to this!


  3. admin
    on May 12th, 2011
    @ 8:43 pm

    my pleasure

Leave a Reply

*

© 2010 unexpected[it]. All Rights Reserved.