Mac OS X Server 10.2 or later: How to Start PHP

This document explains how to start PHP in Mac OS X Server versions 10.2 and later.
Important, before you begin

How to start PHP

For 10.2 to 10.2.8

Follow these steps at the server:
  1. Choose Log Out from the Apple menu.
  2. Log in as the root user. If you need help with this step, see About the root User and How to Enable It.
  3. Open TextEdit.
  4. Choose Open from the File menu.
  5. In the Go To field, type: /etc/httpd/
  6. Locate and open the file named "httpd.conf".
  7. In this file, find the line that reads:

    #LoadModule php4module /usr/libexec/httpd/libphp4.so

  8. Remove the number sign (#) from the start of this line. Do not modify the line in any other way.
  9. Scroll down until you find the line that reads:

    #AddModule mod_php.c

  10. Remove the number sign (#) from the start of this line. Do not modify the line in any other way.
  11. Choose Save from the File menu.
  12. Quit TextEdit.
  13. Choose Log Out from the Apple menu.
  14. Log in as an Admin user.
  15. Open Server Admin and log in.
  16. Stop and restart the Web Server.

For 10.3 or later
  1. Open Server Admin.
  2. Select the Web service from the desired server in the Computers & Services list.
  3. Click on Settings.
  4. Click Modules.
  5. Enable or disable the php4_module as desired.
  6. Save the changes.
  7. Restart the Web Service.

You can verify that PHP is working correctly by connecting to the server and loading the "info.php" page (http://<insertdomain>/info.php). If you have changed the document root or moved this file you, may not be able to do this.
Published Date: Feb 17, 2012