将PHP 5.4.17降级至5.3.x OSX Mavericks [已结束]

Is there a safe way to downgrade the PHP version on OSX Mavericks to 5.3.x without destroying anything badly?

Is there a remove package command or something like that? Apple has upgraded the default PHP version to 5.4.17.

Thanks so much, since I can't find the answer anywhere (yet).

-- edit -- What I have done so so far:

  • Looked for information about downgrading PHP versions on OSX in general (since there are no specific articles about this for OSX mavericks. That didn't gave me the results I looked for. I did not call Apple because, well really Hakre, are you serious?

  • I concidered installing a program like MAMP, but I decided I'd better try to keep my system as clean as possible without running multiple apaches at the same time next to each other.

And Hakre, I think many people will find this question usefull in the future because 5.4 is not really common in production environments.

You can use brew (http://brew.sh/) to install the PHP version that you wish. You can also have several versions of PHP and use the one you like. More info: https://github.com/josegonzalez/homebrew-php

@m4t1t0 pointed me in the right direction today. It was a rough road figuring brew out, figuring apache out.

1. Download Brew first (see @m4t1t0 link, I can't post it) **

2. Install Brew and tap into PHP

I'd like to point to this excellent tutorial of Justin Hileman on how to install PHP via brew. I'd like to advise anyone to follow his steps by the letter.

One caveat (not related to the main issue, but it took me some time to figure it out):

Check in the php the short_open_tag value. In my case I'm dealing with a lot of projects using the short version of the php tag. This setting might be turned off where you'd expected it to be set to On.