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.

Ports, ports, ports

OK, information overload.  The package system is strait forward but ports

The idea behinds ports is good and it works well.  But as a new comer, when I look at the section on ports in the FreeBSD Handbook, information overload.   For every action/command it’s staring at a multiple choice test sheet.  cvsup, portsnap, portmanager,  portupgrade… and I’m sure there are more.    I’ve gone through the ports section of the handbook a couple of times and I’m still not clear what tool is used when.   I’m sure some tools only maintain the tree while other only work on the applications within, but it’s not real clear.   Cheetsheet anyone?