How to install Apache/PHP/MySQL on Mac OSX 10.9 Mavricks?

Apache is installed by default on Mavricks, you just need to start it using the command

sudo apachectl start

Try to access localhost from your browser and you should get the "It works!" message from apache

Now we need to allow htaccess override in our sites, to do that we need to edit the httpd.conf and set "AllowOverride None" to "AllowOverride All"

In your Terminal type the following

sudo vi /etc/apache2/httpd.conf

Scroll down until you find the section starting with <Directory "/Library/WebServer/Documents">

Modify "AllowOverride None" to "AllowOverride All"

You can also enable the php module to run php files and sites, just uncomment this line by removing the # at the beginning

LoadModule php5_module libexec/apache2/

Save the file and restart apache using the command

sudo apachectl restart

To install MySQL you need to first download it from here

Choose the Mac OSX 64 bit DMG version and click download, you don't need to signup just click No thanks...

When you open the file it will have 3 packages that you need to install, right click on the pkg file starting with mysql-5***** and choose Open With and then

Proceed with the install and when it's done do the same with the MySQLStartupItem.pkg

Then right click on MySQL.prefpane then choose Open With and click on System, install it and you should have a screen similar to this one

Just click on Start MySQL Server and you're done!

To change the MySQL root passowrd, open a terminal window and run this command

/usr/local/mysql/bin/mysqladmin -u root password 'mypassword'


I hope you've enjoyed this tutorial and stay tuned for more to come

Share this post