Archive for August, 2011

PHP extensions

Montag, August 15th, 2011

This is a «thank you», going out to all the people taking on the daring, unthankful, and never-completed task of packaging PHP extensions for all the OS and their ever-changing versions out there. Without your work, setting up new systems would be a massive… well, you know.

That being said, if you do so, please take extra care to get your facts straight. If you for example package, say,

php5-pecl-mongo-1.1.4-1.2.x86_64.rpm

for openSUSE 11.3, you should be aware that the person who has to go through the installation, likely already had quite an unfortunate day by having to deal with SUSE in the first place (because, who would take the decision to use it by himself?), and does not want any extra surprises when using an – already hard to find – rpm. The last thing this person wants, is having to deal with fancy ticks of the setup installed.

For example, it would be really annoying to find out, that after the installation your apache does not like to start again, because, strangely, the extension installed with PHP (e.g. /usr/lib64/php5/extensions/mongo.so) can not be found, despite being right there, being owned by the right user, having proper permission, …

Long story short. Do _not_ put any white spaces into the extension’s ini file (e.g. /etc/php5/conf.d/mongo.ini) when trying to describe the location of the extension binary on HDD. Because, even to the trained eye

extension = mongo.so

and

extension = mongo.so

look really „similar“. Do it like the big boys, don’t put any white spaces into said line; especially at the end of the line, where noone will be able to see them (except you make a habit out of unsing a hex editor on everything), even when looking right at the file, suspecting something fishy. Be less human friendly, don’t beautify something, the poor person trying to setup the system doesn’t want to look at – and wouldn’t have had to, if you didn’t.

/rant