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:
- Download the respective packages from the website
- Install them according the instructions
- Stop the httpd that is shipped with leopard (sudo /usr/sbin/apachectl stop)
- Backup existing PHP module: cp /usr/local/apache2/modules/libphp5.so /usr/local/apache2/modules/libphp5.so.orig
- Replace with the Entropy version: sudo cp /usr/local/php5/libphp5.so /usr/local/apache2/modules/libphp5.so
- Backup existing php.ini: cp /private/etc/php.ini /private/etc/php.ini.orig
- Replace with the Entropy version: sudo cp /usr/local/php5/lib/php.ini /private/etc/php.ini
- Edit the httpd.conf in /usr/local/apache2/conf to load the PHP module
- Back up existing httpd.conf in /private/etc/httpd
- Replace it with the version in /etc/local/apache/conf
- Start Apache
- 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.
Just letting you know that the link to PHP Apache Module is incorrect, it links to the postgresSQL database server instead.
The correct link for anyone playing at home is: http://www.entropy.ch/software/macosx/php/
Thanks for putting this walkthrough up.
ko
April 18, 2008 at 4:04 am
Your title mentions Apache, PHP and postgresql. Where is the postgresql library being enabled? How will PHP begin to understand pg_connect() etc? I have apache, php, and postgresl installed on my machine. Now how to connect the three?
Erick
July 2, 2008 at 8:46 am
The php file from Entropy is already configured for Postgresql, so replacing the existing php file will grant you all the pg_ goodies. Once you finish the replacement, run phpinfo() to double check.
Pedro
August 10, 2008 at 11:39 pm
Bitnami’s MAPP stack is much nicer than Entropy, but I want something that installs:
Apache
PHP5
MySQL Latest (5.1)
PostgreSQL Latest (8.4)
Perl
Is there any binary like Bitnami’s that installs all of these? On their forums it seems they’re not interested in creating this very useful binary.
Erick
July 11, 2009 at 3:09 pm