Important, before you begin
1. You will edit the "httpd.conf" file to start PHP service for Apache. Follow these steps carefully, and be sure not to change the file in any other way than specifically described.
2. If Apache does not work as expected or fails to start after you have modified the file, you can delete it and replace it with a duplicate of the "httpd.conf.default" file. After making a duplicate of the default, change its name to "httpd.conf" (to match the one you are replacing). Never modify the original "httpd.conf.default" file.
3. A number sign (#) in the front of a line indicates that the line will not be read by Apache when starting. Removing number signs, as described, causes Apache to read the configuration from that line.
4. Beyond the Knowledge Base, Apple does not offer technical support for configuring or using PHP. See http://www.php.net for more PHP information.
How to start PHP
For 10.2 to 10.2.8
Follow these steps at the server:
- Choose Log Out from the Apple menu.
- Log in as the root user. If you need help with this step, see About the root User and How to Enable It.
- Open TextEdit.
- Choose Open from the File menu.
- In the Go To field, type: /etc/httpd/
- Locate and open the file named "httpd.conf".
- In this file, find the line that reads:
#LoadModule php4module /usr/libexec/httpd/libphp4.so
- Remove the number sign (#) from the start of this line. Do not modify the line in any other way.
- Scroll down until you find the line that reads:
#AddModule mod_php.c
- Remove the number sign (#) from the start of this line. Do not modify the line in any other way.
- Choose Save from the File menu.
- Quit TextEdit.
- Choose Log Out from the Apple menu.
- Log in as an Admin user.
- Open Server Admin and log in.
- Stop and restart the Web Server.
For 10.3 or later
- Open Server Admin.
- Select the Web service from the desired server in the Computers & Services list.
- Click on Settings.
- Click Modules.
- Enable or disable the php4_module as desired.
- Save the changes.
- 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.