Upgrading php5 using ports – recode hell

I recently needed to install a particular php5 module for a project I was working on. What a nightmare.

The process ended up like this:

  • Install module.  Module went and built itself for php 5.3 even though I was running 5.2.
  • Uninstall module.
  • Build php5 and php5-extensions
  • Build fails, some ports that were separate are now part of php5 core port.
  • Uninstall all php5 packages and ports.
  • Build php5 then php5-extensions, again
  • Now apache core dumps when loading php.  *sigh*
  • Remove php5 and php5-extensions and try again.
  • Apache still core dumps.
  • Comment out all the extensions listed in php.ini.
  • Add them back one-by-one, testing after each one to see if apache crashes.
  • Eventually find out that it’s the recode module that is causing apache/php to core dump.
  • Dig around on Google.
  • Find a  post that mentions the php extension load order is important.  recode has to be loaded before the mysql, pspell, sockets and imap php extensions.
  • Move recode to the top of php.ini, start apache, finally everything works.

It took three days to get this all sorted out.   Information about some of the extensions being moved from separate ports into the php5 core port is in the /usr/ports/UPGRADE file, but nothing about recode having to be loaded before particular modules.

Updating the autoconf and automake ports in FreeBSD 8

Upgrading the autotools (autoconf, automake) is not difficult, you just have to remember to update all the key packages.  I’ll be using the portupgrade command to update the autotools.

First, let update our ports tree:
# portsnap fetch
# portsnap update

Now the autotools themselves:
cd /usr/ports/devel
# portupgrade -r autoconf
# portupgrade -r automake

And finally two key packages that will allow the other ports to see the new versions:
# portupgrade -r autoconf-wrapper
# portupgrade -r automake-wrapper

if you don’t upgrade the autconf-wrapper and automake-wrapper ports, you’ll see errors such as this when you try to perform other port upgrades:

autoconf: required version 2.68 not found

even though you have upgraded the autoconf port.

August 2010 edition of BSD Magazine now available

The August 2010 edition of BSD Magazine is now available for download.  Just some of this months topics include:

  • MidnightBSD
  • Network monitoring with Nagios and OpenBSD
  • Replacing Microsoft Exchange

July edition of BSD Magazine now available

The July 2010 edition of BSD Magazine is now available for download. This months topics include:

  • Desktop firewalls with pf and fwbuilder
  • Remote installation of FreeBSD
  • OpenBSD as a mail server

along more how to’s  and interviews.