Click On Tyler Hall

How to Enable PHP5 In Mac OS X Leopard

Friday, October 26 2007

I’ve seen a lot of visitors searching for information on enabling PHP5 in Mac OS X Leopard. It turns out to be quite easy. Leopard ships with Apache 2 and PHP 5 pre-installed. To enable PHP simply:

  • Open your favorite text editor and edit /private/etc/apache2/httpd.conf
  • Uncomment line number 114. It should read

    LoadModule php5_module libexec/apache2/libphp5.so

  • Open System Preferences and go to Sharing

  • Stop and then restart Web Sharing

That’s it!

PS – If you want any easy way to setup and manage virtual hosts on your Mac, check out VirtualHostX.

On Tyler

Originally from Nashville, I'm an engineer working for Yahoo! in San Francisco and paying my way with PHP and Cocoa.