Mac OS X Leopard + Apache 2 + SSL + PHP / macports (gd, etc)
UPDATE 2008/Dec: I am no longer suggesting anyone to go such lengths as following these instructions. There is MAMP for OSX and also XAMPP for OSX. XAMPP is really a nice app, it has the latest php5 (and php4 as well), mysql 5.x, and also has an apache 2 server with ssl enabled
In short it is cool. I have also managed to compile the advanced php cache (APC) for PHP5 as a module - which will be included from PHP6 onwards as a standard library. So go and grab XAMPP, use that and save yourself the headache.
Let me share with you how I was able to set up my local development environment using the Mac OS X leopard built-in Apache (2.2.6) web-server.
First of all I have one of the latest macbook pro laptops. These have the core 2 duo intel processors, which are capable of 64 bit operations. (If you have a simple core duo - then it’s 32 bit only and you won’t face the same problems as me.) Unfortunately - as most of you web developers using php have already found out - the Apple supplied php library for apache is really a stripped-down version of PHP 5.2.4. You can figure it out if you run “php -m” in the terminal.
It does not have the GD library, nor postgresql, not even IMAP - and I could go on and on. I was really in need of having the GD library (used for generating graphics runtime). I have tried to compile all from source - but failed (several times).
And then comes the macports project to the rescue! I would not even consider using the Leopard built-in web-server, but unfortunately SSL on the macports apache 2 on leopard (64-bit) fails miserably (google it if interested). Also I do not like how the MAMP / XAMPP projects are working (fixed path in /Applications, etc.). In contrast the Apple apache works with SSL like a charm.
Step by step instructions:
1., As macports right now cannot compile SSL for its apache 2 subpart (on core 2 duo machines at least) I had to figure out a way to get the Apple supplied apache server to have SSL. As you know for SSL to work you need to generate a self-signed certificate (or buy one from godaddy or verisign or whatever root cert auth. you fancy). This is how you do that.
› Continue reading
Recent Comments