Upgrade to php52 on FreeBSD

By default, after portsnap to latest FreeBSD port tree, it will upgrade your php5.2 to php5.3 automatically. There isn’t any option where you can to remain your PHP version to 5.2.

In order to keep my PHP applications running on PHP version 5.2, what I did is upgrade all php5-* packages to php52-*, but it will be a little waste of time if doing it manually, port by port.

So I written this simple bash to output me the packages of php5-* which need to upgrade to php52-*

The bash will actually output

Before upgrading the php extensions package, upgrade your php52 as below

On the last time, remember to remove “&& \”, or you can press enter key twice to activate the upgrade.