Install Apache, MySQL, PHP on OS/X Mountain lion

Nice guide here

I was unaware that Apache comes preinstalled with OS/X

In a nutshell

  • All the relevant files are at /etc/apache2

  • Starting, stopping, restarting the service is done with
sudo apachectl start
sudo apachectl stop
sudo apachectl restart
  • The default document root is at /Library/WebServer/Documents/ but you can create a different document rule for your user by creating <username>.cnf at /etc/apache2/users/

  • The following fixes a problem of connecting to MySQL from PHP:
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

For more details, check the above link.

Leave a Reply

Your email address will not be published. Required fields are marked *