Note:
Please direct all future questions to Stackoverflow.com.
MAMP PRO customers can direct their questions to support.appsolute.de.
Hinweis:
Bitte posten Sie ab jetzt Ihre Fragen bei Stackoverflow.com.
Unseren Support für MAMP PRO erreichen Sie unter support.appsolute.de.

phpunit on MAMP 1.9.5 broken and work around

Report any found bug here. We are grateful for any useful clues.

Moderator: severin

phpunit on MAMP 1.9.5 broken and work around

Postby dvalentiate » Thu Mar 31, 2011 4:08 pm

If you just want phpunit to work, use the following commands on a fresh copy of MAMP 1.9.5:

Code: Select all
cd /Applications/MAMP/bin
ln -s php5.3 php5
php5/bin/pear channel-discover pear.phpunit.de
php5/bin/pear channel-discover components.ez.no
php5/bin/pear channel-discover pear.symfony-project.com
php5/bin/pear channel-update pear.php.net
php5/bin/pear upgrade pear
php5/bin/pear install phpunit/PHPUnit
ln -s /Applications/MAMP/bin/php5/bin/phpunit /usr/local/bin/phpunit
phpunit --version


Done.

The above code fixes the following issues:

Bug 1:
pear gets confused about its version because it installs in both php5.3 and php5 directory

Pear updates upgrades and installs from /Applications/MAMP/bin/php5.3/pear, but it will create a new /Application/MAMP/bin/php5 directory and spread files between the php5.3 direct and the new php5 directory and get very confused about what version it is.

Fix:
ln -s php5.3 php5

I think that if you are using PHP 5.2 then using ln -s php5.2 php5 should work equally well but I haven't tested this

Issue 2:
pear is out of date

this is understandable of the MAMP team, the problem really was that it was difficult to do a upgrade because of Bug 1

thanks to:
http://jeffreybarke.net/2010/08/how-to- ... with-mamp/
http://www.phpunit.de/manual/current/en ... ation.html
dvalentiate
 
Posts: 7
Joined: Thu Mar 31, 2011 3:42 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby marcelorodrigo » Fri Apr 01, 2011 5:40 pm

Not working here.
After pear upgrade pear ...

Code: Select all
heisenberg:bin user$ php5/bin/pear install phpunit/PHPUnit
php5/bin/pear: line 28: /Applications/MAMP/bin/php5.3/lib/php: is a directory
php5/bin/pear: line 28: exec: /Applications/MAMP/bin/php5.3/lib/php: cannot execute: Unknown error: 0
marcelorodrigo
 
Posts: 3
Joined: Fri Apr 01, 2011 5:38 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby dvalentiate » Mon Apr 04, 2011 12:14 pm

marcelorodrigo wrote:Not working here.
After pear upgrade pear ...

Code: Select all
heisenberg:bin user$ php5/bin/pear install phpunit/PHPUnit
php5/bin/pear: line 28: /Applications/MAMP/bin/php5.3/lib/php: is a directory
php5/bin/pear: line 28: exec: /Applications/MAMP/bin/php5.3/lib/php: cannot execute: Unknown error: 0


Not sure why it is not working for you, did you installed on a fresh download of MAMP 1.9.5?
dvalentiate
 
Posts: 7
Joined: Thu Mar 31, 2011 3:42 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby marcelorodrigo » Mon Apr 04, 2011 1:32 pm

Yes, to be sure I ran the MAMP uninstaller and then deletes all the folders of MAMP in /Applications
Later installed the 1.9.5 version with the errors reported in the previous post. Any suggestions?
marcelorodrigo
 
Posts: 3
Joined: Fri Apr 01, 2011 5:38 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby marcelorodrigo » Mon Apr 04, 2011 2:12 pm

Just have unninstalled MAMP/MAMP Pro and tried again: same error :?
marcelorodrigo
 
Posts: 3
Joined: Fri Apr 01, 2011 5:38 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby dvalentiate » Mon Apr 04, 2011 8:09 pm

marcelorodrigo wrote:Just have unninstalled MAMP/MAMP Pro and tried again: same error :?


Not sure what is going wrong for you. I just reinstalled MAMP 1.9.5 and tried again. Worked for me.
dvalentiate
 
Posts: 7
Joined: Thu Mar 31, 2011 3:42 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby hrward » Fri Apr 15, 2011 9:52 pm

Everything above worked for me except the last command:

MacBook-Pro:bin hrw$ ln -s /Applications/MAMP/bin/php5/bin/phpunit /usr/local/bin/phpunit
ln: /usr/local/bin/phpunit: No such file or directory

Any suggestions?

This post has def been helpful. There are a lot of other people struggling with this. Feels like I'm really close... any help would be appreciated!!
hrward
 
Posts: 2
Joined: Fri Apr 15, 2011 9:50 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby dvalentiate » Mon Apr 18, 2011 11:21 am

hrward wrote:Everything above worked for me except the last command:

MacBook-Pro:bin hrw$ ln -s /Applications/MAMP/bin/php5/bin/phpunit /usr/local/bin/phpunit
ln: /usr/local/bin/phpunit: No such file or directory

Any suggestions?

This post has def been helpful. There are a lot of other people struggling with this. Feels like I'm really close... any help would be appreciated!!


does the /usr/local/bin directory exist, I guess I have assumed it does.

try
Code: Select all
ls /usr/local/bin

if it doesn't exist create it using
Code: Select all
mkdir /usr/local/bin
and then rerun
Code: Select all
ln -s /Applications/MAMP/bin/php5/bin/phpunit /usr/local/bin/phpunit
dvalentiate
 
Posts: 7
Joined: Thu Mar 31, 2011 3:42 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby hrward » Mon Apr 18, 2011 4:23 pm

This did the trick
Code: Select all
ln -s /Applications/MAMP/bin/php5/bin/phpunit /usr/bin/phpunit


I had a few more small issues with PHPUnit once it was running it was trying to include from /Applications/MAMP/bin/php5/bin/ whereas PEAR installed the files under /Applications/MAMP/bin/php5.3/shared/

Once i copied the needed include files into the directories that PHP was looking for everything was up and running. Thanks again.
hrward
 
Posts: 2
Joined: Fri Apr 15, 2011 9:50 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby dvalentiate » Mon Apr 18, 2011 9:59 pm

hrward wrote:This did the trick
Code: Select all
ln -s /Applications/MAMP/bin/php5/bin/phpunit /usr/bin/phpunit


I had a few more small issues with PHPUnit once it was running it was trying to include from /Applications/MAMP/bin/php5/bin/ whereas PEAR installed the files under /Applications/MAMP/bin/php5.3/shared/

Once i copied the needed include files into the directories that PHP was looking for everything was up and running. Thanks again.


Glad you got the to finish line.

Ah looks like you may have skipped the cd "/Applications/MAMP/bin; ln -s php5.3 php5" step.

MAMP didn't set up the pear config correctly so for me it was expecting files in a /Applications/MAMP/bin/php5 directory instead of the /Applications/MAMP/bin/php5.3 directory which pear put its files into. Easiest way around this that I found was the soft link. I might be confusing things with MAMP 1.9.4. But anyway, glad this helped.
dvalentiate
 
Posts: 7
Joined: Thu Mar 31, 2011 3:42 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby gazbond » Tue May 10, 2011 8:26 pm

I'm having problems with this as well. I've followed your advice but I just don't get the phpunit file at the end. Can't I just download the files some where, I've never had much luck with package managers on OSX.
gazbond
 
Posts: 2
Joined: Tue May 10, 2011 8:20 pm

Re: phpunit on MAMP 1.9.5 broken and work around

Postby gazbond » Wed May 11, 2011 7:55 am

Never mind, restarted OSX, uninstalled phpunit, reinstalled phpunit, all good now. Thanks.
gazbond
 
Posts: 2
Joined: Tue May 10, 2011 8:20 pm


Return to Bugs

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

wager-taxi