Mar 29

Enabling PHP on Leopard

Posted by James Netherton | Saturday 29 March 2008 12:32 PM | In PHP,Mac

This post refers to the default Apache HTTP server that ships with Leopard. By default it doesn't load PHP5 which also comes pre-installed with Leopard. Here's how to enable the PHP module.

Open up a terminal session and run through the following steps:

1. sudo vi /private/etc/apache2/httpd.conf
2. Search for the string "php" by typing /php [return]
3. Hopefully you'll have found the line starting, #LoadModule php5_module
4. Remove the # symbol before the LoadModule statement
5. Exit vi and save the file, :wq!

That should be all there is to it. You can start the mac web server and you'll be able to start serving up PHP templates. You will probably also want to do some customisation of PHP.ini. Here's how I did this:

cd /private/etc/
sudo mv php.ini.default php.ini

You're then free to start editing the ini file.

This isn't the greatest solution to get PHP running on Mac. It appears the compiled PHP version shipped with the Mac is missing some useful modules such as SOAP.

 

0 Comments

[Post comment]


Leave a comment








Captcha text