Installing PHP on Mac OS X

There are a few different options for installing PHP with Apache on Mac OS X, including building from source as described in the previous section. However, the simplest method is to install PHP from a precompiled binary package, namely the ones distributed by a developer named Marc Liyanage.

By the Way

If you would like to build PHP from the source and are comfortable with the Mac OS X operating system and using the terminal, feel free to follow the instructions in the PHP Manual, at

To obtain the PHP installation package, go to and look for the section titled "Installation Instructions." Once there, follow the link to download PHP 5 for your version of Mac OS X. It is likely that this version of PHP will be a few versions behind the current Linux/UNIX build files or Windows installer.

When the download is complete, mount the disc image and double-click on the *.pkg file. Perform the following installation steps to complete the process:

  1. The PHP installer will launch automatically, as shown in Figure 4.1. Click Continue to move to the next step.

    Figure 4.1. The Mac PHP Installer has started.

  2. The next screen will ask you to select the destination. Select the drive, as shown in Figure 4.2, then click Continue.

    Figure 4.2. Select the installation location.

  3. You will be prompted for the Administration username and password, unless you are installing as root. If so, enter these values and click the Continue button.

  4. The installation process will continue, installing PHP and optimizing the system. When the process is complete, the installation program will say so, as shown in Figure 4.3.

    Figure 4.3. PHP installation is complete!

The PHP installation program has made all the necessary changes to your Apache configuration, so there's nothing left for you to do except skip ahead to the "Testing Your Installation" section.

Sams Teach Yourself PHP, MySQL And Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (3rd Edition)
ISBN: 0672328739
EAN: 2147483647
Year: 2004
Pages: 327

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: