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.