Articles‎ > ‎

PHP on Mac

posted Jan 29, 2011, 2:29 AM by Michael Schollmeyer
Hosting some PHP pages on your MAC is easy and straightforward. Go to System Preferences, then to Sharing and check Web Sharing

This will start an apache on your machine. In the default configuration, pages will 
be hosted in the Sites folder of your local home folder /Users/liv if your user name is liv. Just put some pages in there and point your browser to http://localhost/~liv.


Some resources on the net suggest that you should check and again uncheck Web Sharing to restart you apache when this is necessary. This did not work for me. A better solution is to open a shell and type 

apachectl restart 

Where is GD?

apache and PGP is prepackaged and works fine for basic requirements. One of the essentials that are missing is the <em>GD</em> library. This library is for image I/O. 

I found lots of resources on the net, but most of them are complicated, they ask you to recompile PHP, apache or both. A good solution can be found here.