Sunday, October 5, 2008

PHP and MySQL with Apache on Mac OS X

The process of installing the *AMP (Apache, MySQL, PHP) on Mac OS X is basically like the typical install of LAMP.

First, to start the web server, go to system preferences, turn sharing on, and check the Web Server check box. This enables the /Library/WebServer directory to be open on the web. The web address will be displayed within the system preferences pane for the sharing. The /Library/WebServer/Documents folder will now host the files for your web server. An HTML file can be held here.

To add PHP, go to the http.conf file and uncomment the LoadModule directive for PHP. A default install of PHP is already installed on Mac OS X. Restart Apache and now a PHP file can be place in the /Library/WebServer/Documents folder and it will process as usual.

To add MySQL, the MySQL package for Mac OS X must be downloaded from MySQL for Mac OS X
website. It is necessary to make some configurations for your system to run MySQL. The configuration of MySQL on Mac OS X can be accomplished by following the directions on that website.

No comments: