On Getting PHP, MySQL, and Apache To Play Nice

Technical post, so beware. This is another of my technical notes to my future self, when I've forgotten what I learned today.

I intended, this morning, to very briefly update PHP from 5.1.0 to 5.1.6, Apache from 2.0.55 to 2.2.3, and OpenSSL from 0.9.7something to 0.9.8b. That turned into three hours, with Web sites dead during most of that time, or at least misfiring.

Two critical problems occurred in the upgrade, that, once solved, seem to solve a number of other odd behaviors I've seen over the last couple of years.

First, I've been using the glibc 2.2 static version of MySQL. I should have been using the plain 686 version, which is built against glibc 2.3. That allowed PHP to compile and work at long last against the client libraries.

Second, I should have had this directive in the httpd.conf files:

AddHandler php5-script .php

Third, I needed to have zlib installed to (it seems) appropriately compile PHP with MySQL's client libraries.

Now, everything not only works, but things that were erratic--I had to keep PHP 4 and 5 running for different Web servers--seems to have totally disappeared.