Apache Mysql on MacOS

Installing Apache, MySQL, and PHP in OS X Maverick


PHP Setup

PHP 5.4.17 is loaded in the latest preview of OSX 10.9 Mavericks and needs to be turned on by uncommenting a line in the httpd.conf file.

sudo vi /etc/apache2/httpd.conf

Search for ‘php‘, this will land you on the right line, then uncomment the line (remove the #).  This is what the line should look like:

LoadModule php5_module libexec/apache2/libphp5.so

Save the file and reload apache: sudo apachectl restart

To see and test PHP, create a file in your document root and name it “phpinfo.php”. Edit the file and put the following line in it:

<?php phpinfo(); ?>

Browse to the following page and you should see all the php information: http://localhost/phpinfo.php


Leave a Comment

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