Compiling PHP Development Version

I had cause this week to install an additional version of PHP onto my development server. This is because I wanted to look at the code for forkr which is targeted at PHP 5.3, which isn’t out yet. So I trotted across to snaps.php.net and downloaded the current version of PHP 5.3.

I then used the following steps to compile PHP:

./configure --prefix=/usr/local/php5.3 --with-apxs2=/usr/bin/apxs2
make
make test
make install

The configure arguments are to get the resulting code put into /usr/local/php5.3/ and to specify where to find apxs2 itself. Strictly speaking the “make test” step is optional, however as this is a development version of php I consider it polite to run this automated test and then press the button to submit the results at the end, it runs quickly and if it helps the QA people, then great.

It was at this point that I realised that I had overwritten a pre-existing file, critically it was /usr/lib/apache/modules/libphp5.so, the shared object file for my existing PHP installation! I fiddled with the PHP configuration at length but could not figure out how to get PHP to spit a differently named or located file out of the other end of the process.

This evening I mentioned my problem in the #phpc channel on freenode (warning, its not a help channel, don’t go there and ask questions, you won’t get a warm welcome) and after some prodding from the guys there I worked around my problem by skipping the make install step – its this step which uses apxs to move the file and causes my problem. The makefile shows the list of install targets, and I needed to exclude install-sapi. My steps now look like this:

./configure --prefix=/usr/local/php5.3 --with-apxs2=/usr/bin/apxs2
make
make test
make install-cli install-build install-headers install-programs install-pear
cp libs/libphp5.so /usr/lib/apache2/modules/libphp5-dev.so

The new make install line just installs the bits I’ll want, it seems that any combination of these can be used, depending on which bits of the language will be needed. The final line copies the apache module into the correct location for my system (Ubuntu Gutsy Gibbon).

Non-technical Postscript

I just wanted to add a note here to say that I would probably never have got to the bottom of this problem if I hadn’t been collectively rescued from it by some of the seriously leading lights in the PHP community – people who shouldn’t really know my name never mind stop to help me with a fairly basic problem. So thanks and hugs to Derick, Johannes, Davey and Ben. Thanks guys – for solving my problem *and* reminding me why the PHP Community is a cool place to be!

PHP Parcel

Today I picked up the parcel that Royal Mail tried to deliver last week – and it was a box of goodies from the good Cal Evans at Zend!! A while ago Cal ran a competition and then announced that this post had been one of the winners.

Well, I’ve got the prize in question, Scalable Internet Architectures by Theo Schlossnagle, which actually looks really good. Its a book that has come at a good time for me – I’m at a point where I can write a website in my sleep, but understand where the weak points are that might cause it to crumble under load is a whole new chapter.

Also included in the package were a set of trading cards from Zend Con ’07 (here’s the flickr set), with Cal’s one autographed! Finally, and possibly most excitingly, I got an elePHPant! Here he is meeting tux:

Have a look at the other photos tagged with elephpant on flickr too!

PHPWomen Podcast

I’m wildly excited about a virtual event scheduled for next week, its the PHPWomen PHP|Abstract. Some of the main members, Elizabeth, Elizabeth, Ligaya and Sara are all going to chat with Cal Evans about the group, with live participation on IRC.

Actually I wonder if Cal knows what he is taking on here, he’s going to have his hands full trying to keep these four ladies under control :) He’s also running a competition – an elephpant for the best question asked in the IRC channel while the ‘cast is happening … I really want one of these critters so if you have any question suggestions then please pop them in the comments for me.

Its at 6PM CT which I think its midnight here in GMT (or UTC). You can listen live by dialling a toll-free number, only available from within the US however Skype’s documentation seems to think I can call a US toll-free number over skype from here in the UK so this will hopefully prove to allow access for anyone outside the US who would like to listen. Very importantly there will also be a real-time interaction with the #phpwomen channel on irc.freenode.net so drop in if you’d like to. If you’re new to IRC then find instructions on the IRC primer I wrote for PHPWomen. Hope to see some new faces joining us on this one!

PDO for PHP on Ubuntu Edgy Eft

Today I was asked to add PDO support to PHP on our development box, which I thought was running Ubuntu Feisty Fawn. The first problem is that it’s not running Feisty Fawn, its running Edgy Eft, which is an older version. The next problem is that the PDO libraries weren’t bundled with Eft.

PDO is available in PECL so, using these instructions from Rich Buggy I grabbed the mysql client development libraries from aptitude and then got the PDO libraries I needed.

Frankfurt Visit: First Impressions

I’m in Germany for a few days at the IPC and since we had some time spare I’ve been exploring!

First of all, we took trip into Frankfurt itself yesterday. The queue for the ticket office was wildly long but some people who had a weekend travel pass and had returned to the airport to catch a flight gave us their train tickets which was really lucky (and nice of them).

Once in Frankfurt I put my card in the cash machine to get some money out – we decided it would be better to take money out on demand rather than changing it before we travelled. I had a bit of a deja vu moment when I put in my card and out came strange-looking money … its just like going to Scotland really :)

We were quite lucky as apparently Frankfurt is usually completely closed on a Sunday (I didn’t know that) but it was a special day of some description so all the shops were open in the afternoon. Its too early for the Christmas Markets but there were plenty of sausages and Gluhwein stalls on the streets all the same. Loads of the cafes had tables on the street – personally I think its too cold in Northern Europe in November for that but we ate outside all the same and it seemed a popular choice. We took some photos but they will have to wait until I get home to my own computer and a faster net connection!

Today we’ve been into the local place, Morfelden, which is tiny but has nice cafes and so on. I even managed to sniff out the wool shop and couldn’t resist buying a couple of balls of wool! I’ll knit something to remind me of my visit here I think, not sure what though.

Looking Forward to IPC

Next week I’ll be attending the International PHP Conference in Frankfurt. There aren’t a lot of PHP Conferences outside of the USA and as such this one is about as local as they get (other than PHPLondon of course!).

I’m hoping to learn some new things from the various talks during the 2-day conference, and to come back itching to try out new stuff! I’ll be meeting lots of new people as well, some of whom I’m “met” online already, and some of whom are completely new. Other than that I’m really not sure what to expect at all.

If you’re going to IPC, then pop over and say hi, I’m the tall, loud one in a phpwomen t-shirt :)

Textpattern to Serendipity Migration Scripts

Not terribly riveting reading but this is the story of my migration from textpattern (version 4.0.4) to serendipity (version 1.1.3). This includes some PHP scripts I used to fix some problems on import – they’re not the best or the most robust in the world but they worked for me and I wanted to pop them here in case they work for someone else. Feedback on the code isn’t necessary because I won’t be using it again ;)

A running start

Firstly let me say that serendipity has a fabulous import feature which brought in 90% of my content about 30 seconds after I saw the button labelled “Import Data”. This is a real hurdle-remover for new users and definitely clinched the deal for me. Having done this I found that:

  • I had weird entity encodings everywhere
  • my images hadn’t arrived
  • everything seemed much more spaced out than it had been on the old blog

Images

The images hadn’t been transferred and I also realised that the custom tags that textpattern uses, such as:



hadn’t been handled by the import script, so I kind of had two problems to solve. I started by transferring all the images across and renaming them to something more helpful.

This is going to be a really long article, but do read on if its helpful – I’m posting the rest as extended content so the disinterested need not scroll past it! Continue reading

Happy Birthday PHPWomen

I knew we’d passed the anniversary mark recently but didn’t know exactly when – however, its happened. Happy Birthday PHPWomen!!!

The group has brought me friendship, direction, and moral support in quantities I never dreamed existed. Long may it continue :)