Blue Screen Of Duds

Where the alter ego of codelust plays

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

with 4 comments

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.

About these ads

Written by shyam

December 14, 2007 at 12:47 pm

Posted in Apache, Apple, Leopard, Mysql, OSX

4 Responses

Subscribe to comments with RSS.

  1. 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

  2. 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

  3. 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

  4. 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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: