. mombe.org
home of the mad cow
  Not A Blog

Wednesday, August 11, 2004

PHP 4.3.8

This is for those of you who both use FreeBSD and haven't yet upgraded to PHP 4.3.8 (or are sitting at 4.3.8_1). It is posted in the hopes that I save someone else the aggrivation I went through.

There are several changes to the way FreeBSD's lang/php4 port works starting from version 4.3.8. The most significant is that PHP changes from a single static module to a bunch of dynamically loaded objects. You used to configure your build options in lang/php4 port, but these have now been seperated to a new lang/php4-extensions port. Each of the extensions (for example, mysql) lives in a port of it's own (eg databases/php4-mysql). The lang/php4-extensions port is simply a meta port that provides you with a nice config interface and brings all these little ports together.

The advantages of this should be immediately apparent. You no longer need to rebuild all of PHP to get an extension. The caveats aren't so apparent.

The changes between 4.3.7 and 4.3.8 are quite well documented in /usr/ports/UPDATING, and being a good ports updater, you should read that. It says:

  AFFECTS: users of PHP
  AUTHOR: ale@FreeBSD.org
The old lang/php4 and lang/php5 ports have been splitted into 'base' PHP, PEAR, and shared extensions to allow more flexibility and add new features. Upgrading your current PHP installation will result in a 'base' PHP installation (no PEAR and no extensions). PEAR can be found in the new devel/php4-pear and devel/php5-pear ports, while the set of PHP extensions to install can be choosen via the meta-ports lang/php4-extensions and lang/php5-extensions, or installing singular extensions individually. If you have a previous php.ini configuration file, be sure to comment out the extension_dir parameter, since the correct path is statically compiled into the PHP binary. For an overview of the modules used with the old PHP binary, use the command "php -m".

Useful things to know include the fact that there is now a php.conf in ${PREFIX}/etc which, amongst other things, specifies where your extensions live. You can safely comment the extension_dir option in your php.ini as php.conf will tell PHP where to find it (its compiled in I suspect :)

What wasn't well documented (and fscking irritaing) was the changes between the 4.3.8_1 port and the 4.3.8_2 ports. I did a portupgrade and everything broke for no apparent reason. My error logs complained about duplicate definitions of functions.

I originally thought I'd built a static binary and spent ages trying to work out *how* I had done this. I couldn't.

In desperation, I appealed to the source and discovered a small but highly significant change. The --with-config-file-scan-dir=${PREFIX}/etc/php configure option means that PHP looks in another place for it's config files in addition to the normal ${PREFIX}/php.ini

One of the files in this new ${PREFIX}/etc/php/ directory is called extensions.ini, which is where lang/php4-extensions and its friends document their existence. In other words, my duplicates were because I had identical extension lines in both php.ini and php/extensions.ini

The solution, once you know this is simple. Remove all the extension options from php.ini

Note that if you go straight from 4.3.7 to 4.3.8_2 you won't have this problem. It'll seamlessly just work. That helps add to the confusion when you're upgrading multiple machines *grr*

posted by guy at: 22:30 SAST | path: /systems | permanent link

Wednesday, February 11, 2004

IPv6 (aka IPng)

Russell, Vhata and I spoke the other day about Rhodes getting a proper IPv6 test up and running. Well today I took the bull by its horns and got Jacot to put his signature at the bottom of my application for a /48 assignment.

The application form was faxed off to TENET this afternoon. I've got no idea how long they take, etc. In the mean time, we have an IPv6 enabled firewall and DNS server. We have to run reverse as a condition of the application - see http://www.tenet.ac.za/IPv6_assignment_Policies_v1-0.htm

I suspect at the end of the day some IANA assignment is now going to list me as the technical contact :)

See more ...

posted by guy at: 00:00 SAST | path: /systems | permanent link

Bloxsom Powered

© 2002-2005, webmaster@mombe.org
RSS Valid XHTML 1.0!

Creative Commons License