Upgrade fun
I really wanted to try out this WordPress plugin called ImageHeadlines that created images of your title headlines from any TrueType font. It’s a neat idea, and you can make your headlines really look cool with dropshadows, etc. One not-so-minor problem: my PHP install doesn’t have a working FreeType installation. “Well, time to fix that,” I figured.
First things first: oh, there’s a new version of PHP out. Well, let’s upgrade that while we’re at it! The configure and build of 5.1.1 (without Freetype enabled) went smoothly, but APC (the bytecode compiler) wouldn’t load… which pretty much means, I can’t run PHP. Seems the Zend internal version number/datestamp changed. OK, let’s just recompile APC… now, how did I do that again? Something to do with pear… oh wait, pecl! Fine. At first glance it seemed as if “pecl upgrade APC” was going to get it done… yeah… riiiight; pecl claims it’s already installed. Finally, “pecl install -f APC” did the trick (force it to reinstall, notice the new config from rerunning phpize, and build a version matched to the new Zend engine). Next, on to Freetype…
Now, I do actually have an older build of Freetype (both 1, and 2) installed on the machine, but PHP has never managed to successfully build against it. OK, get the latest source from freetype.org, poke around with locate and grep a bit to try and determine which install is which (not quite sure where the v1 install is from, but the older FT2 is from an old RPM… and there’s no new RPM available (even in source format) for my old Linux install.) OK, figure out installing to /usr/local as the prefix should do the trick. Get that built (so far so good!) and installed.
Back to PHP: try to get it to recognize and enable Freetype support. This ended up being the magic of all three of –with-gd (duh), –with-freetype-dir=/usr/local (ok) and –enable-gd-native-ttf (like that’s obvious!) Then of course, deal with configuration caching issues (i.e., even though I changed the parameters to configure, and the make did seem to build differently, freetype was still not enabled…) Finally I just gave up and did a rm config.cache; make clean first, and the ensuing build finally had everything in it. Another install surrounded by stopping and starting apache, and we had goodness–on the ImageHeaders requirements side, anyhow.
ImageHeaders’ config screen within WordPress wasn’t giving a big nasty error anymore–it was just giving a blank screen. I finally added an “error_reporting(E_ALL)” temporarily into its script, just to try and figure out what was going on, and ended up seeing the problem: my image directory never got moved over after the 2.0 upgrade! Duh. Put that in place, and hey, cool, the plugin worked. I uploaded some TTF fonts, and modified my templates to request images for titles. It worked… but I still wasn’t happy with the way it looked. No matter what, I didn’t feel it was “worth it”, or maybe I just needed a lot more talent for picking colors and typefaces… but either way, I wasn’t really feeling it. I ended up reverting the template changes, and sticking with the stock CSS methods.
I do still have the plugin installed and activated, however, and so it can be used for other stuff… more showing off than anything. For example: example removed due to breakage -Ben< ?php /* echo ImageHeadline_render("The plugin can render text in posts","font_color=#288&font_size=30&shadow_spread=5&font_file=/var/www/vhost/benjolo/wordpress/wp-content/image-headlines/Newcastle.otf"); */ ?> which is vaguely nifty but I don’t really know when I’d use it. Maybe for special dingbats ocassionally.
Overall, the exercise wasn’t actually that bad, timewise. It just kinda sux that after all that, I really don’t think I’ll be using the plugin!
And a final postscript: that wasn’t quite the end of the story. I noticed WordPress pages weren’t always being fully rendered… checking the apache error logs, I noticed lots of child segfaults; the new PHP 5.1.1 build wasn’t stable. Usually this is actually an APC problem, but as I definitely need that, the easiest thing to do was just revert PHP builds. Sigh…
Tarmadol….
Tarmadol….