I have set up Apache and PHP on my computer many times, every time I googled or Baidued about it, it is high time to keep a note about those steps.
- sudo mate /etc/apache2/httpd.conf
- uncomment “#LoadModule php5_module libexec/apache2/libphp5.so”
- save the file and quit.
- sudo cp /etc/php.ini.default /etc/php.ini
- sudo apachectl start
- ln -s /Library/WebServer/Document $HOME/www
- rename the file “index.html.en” or just delete the file if you do not want to be botthered.
That’s the steps all it takes to set up your apache and PHP on a MAC OS machine.