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-*
for d in `portversion -vL= | grep php5 | awk '{print $1}'`; do OLD=`echo $d | cut -d - -f 1,2`; NEW=`echo $d | sed s/php5/php52/ | cut -d - -f 1,2`; THEPATH=`whereis $NEW | awk '{print $2}' | cut -d / -f 4,5`; echo "portupgrade -o $THEPATH $OLD && \"; done
The bash will actually output
portupgrade -o textproc/php52-simplexml php5-simplexml &&
portupgrade -o devel/php52-spl php5-spl &&
portupgrade -o databases/php52-sqlite php5-sqlite &&
portupgrade -o devel/php52-tokenizer php5-tokenizer &&
portupgrade -o textproc/php52-xml php5-xml &&
portupgrade -o textproc/php52-xmlreader php5-xmlreader &&
portupgrade -o textproc/php52-xmlwriter php5-xmlwriter &&
portupgrade -o archivers/php52-zip php5-zip &&
portupgrade -o archivers/php52-zlib php5-zlib &&
Before upgrading the php extensions package, upgrade your php52 as below
portupgrade -o lang/php52 php5
On the last time, remember to remove “&& ”, or you can press enter key twice to activate the upgrade.
Related posts:
- Disable Vulnerabilities Check in FreeBSD Portupgrade After perform FreeBSD portsnap, there are updates for PHP52 packages,...
- How To Fix php5-pcre Ignored Package in FreeBSD Ports I guess most of the FreeBSD users having problem to...
- Bash: How to Echo Tab and Newline While printing out result in bash, sometime we need to...
- Problem Upgrade Apache2 on MacPorts I was trying to upgrade apache2 on my Macports but...
- Arrays in Bash Arrays is useful when it comes to data processing. Using...
- postgresql82-server compile error on Apple Leopard with Macports 1.5 I wasn’t able to compile postgresql82-server on my machine, it’s...
- How to Change User’s Shell Environment in FreeBSD In FreeBSD, user’s default shell environment is either sh or...
- FreeBSD Port: Error Upgrading Perl 5.8.9 Usually I perform portupgrade daily on some of my FreeBSD...
- Grep Exim Email Transaction with Bash While email transport having problem, the first we look for...
- freebsd port update, monitor outdated port with portsnap we have about 15 freebsd servers with us, ranging from...
Tags: freebsd, php, ports, portsnap, portupgrade