2.1. Checking the PHP Installation

To see whether PHP is installed, search your hard drive for any PHP files:

  • Linux/Unix/Mac: Type the following:

    find / -name "php*"
  • Windows: Use the Find feature (choose StartFind) to search for php*. In general, PHP isn't installed on Windows computers.

If you don't find any PHP files, PHP isn't installed. Later in this chapter, we describe how to obtain (see "Obtaining PHP") and install (see "Installing PHP") PHP.

If you find PHP files on your computer, PHP might or might not be ready to go. The files might reside on your hard drive, but PHP might not have been installed. Or, PHP might be installed, but it might not be the most recent version. You might want to install the most up-to-date version.

You can test whether PHP is ready to go using the testing procedure described in the section "Testing PHP," later in this chapter. The tests in that section determine whether PHP is installed and tell you which version is installed.

Most Mac OS X versions since 10.3 come with PHP already installed, but Apache might not be configured to handle PHP code. If PHP is installed on your Mac but doesn't seem to be working, try following the instructions in the section "Configuring Your Web Server for PHP," later in this chapter. Editing the httpd.conf file might be all you need to do to get your PHP up and running.

Get PHP & MySQL® Web Development All-in-One Desk Reference for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.