Enable PHP on MAC OS X (Apache default webserver)

If you have your Apache on MAC OS X already setup and running continue to read otherwise read this first Apache on MacBook.

otherwise here is what you need to do to enable the built in PHP plugin:

edit the apache conf file (I’m using vi to edit the file but you can use whatever editor you want)

sudo vi /etc/apache2/httpd.conf

uncomment the following line by removing the # at the beginning of the line

LoadModule php5_module      libexec/apache2/libphp5.so

rename php.ini.default to php.ini

sudo mv /etc/php.ini.default /etc/php.ini

then change the php.ini error report to (option)

sudo vi /etc/php.ini

error_reporting = E_ALL & ~E_NOTICE

then you can edit the php.ini file as you desire.

to apply the changes you need to restart Apache

System preferences -> untick web Sharing -> tick it again

This entry was posted in MAC OS X, PHP, web server and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
blog comments powered by Disqus