Enabling Apple’s Supplied PHP in OS X 10.4 Tiger

Alert!: Attention: Cet article/tutorial est ‰gé de plus de 45 jours. Ainsi les informations qu’il contient peuvent être, maintenant, dépassé. Merci de lire toutes les informations qu’il contient pour vous assurez que cet article fonctionnera bien sur votre système

The first thing that many will want to do after they install their shiny new copy of OS X 10.4 Tiger, will no doubt be to restore PHP to their WebServer. This is the quickest, easiest way, that anyone can manage that end.

This tutorial demonstrates how to activate Apple’s PHP, as supplied, out of the box. This is a very quick and easy method that will suit beginners, and will keep more advanced users happy while they wait for the energy to build and install PHP from source.

1. Step One
Locate the “Terminal” application. It comes with every OS X installation and can be found in the Utilities folder, in the Applications folder on your Mac OS X main drive. Open this application.

2. Step Two
Once in the terminal you will be greeted with something like the following text:

Last login: Sat May 7 00:28:29 on ttyp1
Welcome to Darwin!
ibook:~ username$

The $ represents the prompt, or the place that you, the user, types your input. To enter a command; type it in, and press Enter.

3. Step Three
Enter the following commands (not including the $. Remember, they represent the prompt) one line at a time, pressing Enter after each line:

$ cd /etc/httpd
$ sudo pico httpd.conf

4. Step Four
In the last command, we opened the Apache Web Server configuration file in a text editor called “Pico”. You will need to enter your password. We now want to edit this file to enable PHP.

Press Control-w on your keyboard, then enter “php” and press Enter. This will search for the first occurrence of “php” in the Apache configuration file.
You should come to the following line.

# LoadModule php4_module libexec/httpd/libphp4.so

Remove the # (hash sign) from the beginning of the line. Press Control-w again, and then Enter. Repeat this until you reach the following line:

# AddModule mod_php4.c

Once again, remove the # (hash sign) from the start of the line.

5. Step Five
We have now made all necessary changes to the file. Now we must save these changes. Press Control-o (the letter, not zero) and then Enter. The file is now saved. Press Control-x to exit Pico.

6. Step Six
The last step is simply to restart Apache, so that the changes we made to the configuration file take effect. You can simply use the “Sharing” System Preference Pane to restart Web Sharing. Or you can enter the following command in the terminal:

$ sudo apachectl restart

You may need to reenter your password.

That’s it, PHP will now work as part of Apache.

If you’re having problems you can use PHPmac support to get free one-on-one support via email.

*Requires Login

Leave a comment

Your email address will not be published. Required fields are marked *