Running Apache 2, PHP5 (Entropy) with Postgresql on Leopard

Update: New post on installing from source here.

Getting Apache 2, PHP 5, MySQL 5 and Postgresql 8 on Leopard was not as easy as it was made to look, so I am noting it down so that it could help somebody later.

This does not deal with installing PHP or Apache from source which can be a bit hairy on OSX.

This was done on OSX Leopard, I have no idea if the same will work on Tiger, Panther etc.

Follow the instructions at your own risk. It did not blow up my Macbook Pro in doing this, but I can't guarantee you that you'll extract the same mileage.

All binaries have been downloaded from Marc Liyanage's website (thanks Marc!):

Steps:

  1. Download the respective packages from the website
  2. Install them according the instructions
  3. Stop the httpd that is shipped with leopard (sudo /usr/sbin/apachectl stop)
  4. Backup existing PHP module: cp /usr/local/apache2/modules/libphp5.so /usr/local/apache2/modules/libphp5.so.orig
  5. Replace with the Entropy version: sudo cp /usr/local/php5/libphp5.so /usr/local/apache2/modules/libphp5.so
  6. Backup existing php.ini: cp /private/etc/php.ini /private/etc/php.ini.orig
  7. Replace with the Entropy version: sudo cp /usr/local/php5/lib/php.ini /private/etc/php.ini
  8. Edit the httpd.conf in /usr/local/apache2/conf to load the PHP module
  9. Back up existing httpd.conf in /private/etc/httpd
  10. Replace it with the version in /etc/local/apache/conf
  11. Start Apache
  12. Profit?

I know it is not the best or the most proper way possible. But after many days of poking around, this was the easiest and I am not one to complain about that.