Multiplay Labs

tech hits and tips from Multiplay

Archive for August 15th, 2014

Quick way to upgrade php dependencies using FreeBSD’s pkgng

without comments

Even though the new FreeBSD package manager, first introduced 10.0-RELEASE, is significantly better than the old one it still doesn’t deal with all dependency issues when performing an upgrade.

One case where it trips up is when upgrade php that has pecl or pear modules install due to the fact that the ports tree doesn’t have the required dependency information.

This can result in a broken php install which modules that fail to load as they haven’t been upgraded.

A simple fix for this is to run the following:

pkg upgrade
pkg install -f `pkg info -x pecl pear | awk -F'-' '{for (i=1;i<NF-1;i++) { printf $i FS } print $i NL }'`

If your running php-fpm then restart it:

/usr/local/etc/rc.d/php-fpm restart

Update: 12th Dec 2014
Switched from pkg upgrade -f `…` to pkg install -f `…` due to a change in behaviour of pkg after 1.3.7

Written by Dilbert

August 15th, 2014 at 5:42 pm

Posted in FreeBSD

Tagged with , , ,