Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Please: Apple's Mountain Lion to Display Updated PHP Version

Status
Not open for further replies.

jd65

Technical User
Jan 11, 2013
4
US
Hello, I'm hoping someone can help me out here.

I successfully installed PHP 5.4 on my Apple Mac (o/s is Mountain Lion) using [URL unfurl="true"]http://php-osx.liip.ch[/url]'s binary package. Confirmed by running phpinfo.php test file.

The problem is, if I run the Terminal command, php -v, I get PHP version 5.3 displayed.

Now, if I edit my .bash_profile with export PATH=/usr/local/php5/bin:$PATH and run php -v, I get the correct updated version. The issue here, unfortunately, is I get all kinds of warning issues with my Homebrew package manager, after running brew doctor. Since I don't want that, I thought it might be better to use a symbolic link, as follows:

PHP5.4 is installed in /usr/local/php5/bin. If I type the Terminal command, whereis php, I get /usr/bin/php.

Attempting a symbolic link: ln -s /usr/local/php5/bin/php /usr/bin/php, I get the output ln: /usr/bin/php: File exists.

Is there something I'm doing wrong? Is this incorrect?

I'd be eternally grateful for any help!

Thanks in advance,
jd65.
 
the php binary already exists at the source location. rename it. then try the symbolic link again.
Code:
sudo mv /usr/bin/php /usr/bin/php-old
sudo ln -s /usr/local/php5/bin/php /usr/bin/php

but ... i doubt whether that's the end of it. you've made it difficult to help in this forum because:

1. this is a php forum. you are asking questions that are only peripherally relevant to php. really you should be asking in the mac osx forum or a Homebrew forum (as your main complaint seems to be that you do not want the homebrew package manager to throw warnings).

2. you have not expressed what the Homebrew warnings might be; so no help can be provided at that level.

Overall I really don't think it's a great idea to install a binary php version in place of the native. it would be better, imo, to recompile the source over the existing version (taking a time machine snap shot first, jic).

For my part, having developed on macs for years and years, I use MAMP which creates a completely separate and sandboxed php install. I also reconfigure it to use the same pear library of my native php installation (I don't use pecl extensions).

i'd be interested to know why you want/need 5.4 over 5.3. The updates are very specific and to my mind represent a continuing trend within the php core-dev team to bring more and more c-based functionality directly into the php-core. Overall I think this is a shame, but perhaps I'm missing something that the developers are deliberately intending to shift php's positioning from primarily web to primarily cli scripting. Don't get me wrong though, I am looking forward to being able to use the function array dereferencing and to being able to access class members on instantiation. the new upload progress meter seems interesting but more gimmicky than useful.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top