Installing PHPUnit on MAMP 2.1.3 (Mountain Lion)

前端 未结 3 383
不知归路
不知归路 2020-12-19 14:38

I\'m struggling with this issue. Here\'s what I\'ve tried :

$ cd /Applications/MAMP/bin/php/php5.4.10/bin/
$ sudo ./pear channel-update pear.php.net
$ sudo .         


        
3条回答
  •  没有蜡笔的小新
    2020-12-19 15:05

    I've met this problem this morning and find this topic but no answer is helpful. After a couple of hours google search, I found this link, it helped me solve my problem http://www.startupcto.com/server-tech/macosx/installing-phpunit-on-mamp

    My MAMP php version is 5.5.3 First, you'll probably need to update PEAR:

    sudo /Applications/MAMP/bin/php/php5.5.3/bin/pear channel-update pear.php.net
    
    sudo /Applications/MAMP/bin/php/php5.5.3/bin/pear upgrade pear
    

    After that, add the appropriate PEAR channels for PHPUnit:

    sudo /Applications/MAMP/bin/php/php5.5.3/bin/pear channel-discover pear.phpunit.de
    sudo /Applications/MAMP/bin/php/php5.5.3/bin/pear channel-discover pear.symfony.com
    sudo /Applications/MAMP/bin/php/php5.5.3/bin/pear channel-discover components.ez.no
    

    Finally, install PHPUnit:

    sudo /Applications/MAMP/bin/php/php5.5.3/bin/pear install phpunit/PHPUnit
    

    Test phpunit to make sure it was installed correctly:

    /Applications/MAMP/bin/php/php5.5.3/bin/phpunit --version
    

    Link phpunit to your path

    sudo ln -s /Applications/MAMP/bin/php/php5.5.3/bin/phpunit /usr/local/bin/phpunit
    

    Hope this help you and anyone meet this problem in the future!

提交回复
热议问题