PHP with apache on Mac OS X

Enable apache server with System Preferences -> Sharing -> Web Sharing -> Enable

sudo emacs /etc/apache2/httpd.conf

# Comment in the following lines
#LoadModule php5_module        libexec/apache2/
#LoadModule fastcgi_module     libexec/apache2/

# Restart apache to pickup config changes
sudo /usr/sbin/apachectl restart

By default two sites are setup. http://localhost/ which maps onto /Library/WebServer/Documents/ and http://localhost/~user which map onto /Users/username/Sites/.

Categorized as geek Tagged ,

Leave a comment

Your email address will not be published.