How do you get php working on Mac OS X?

To get PHP working on Mac OS X, you can follow these steps:

  1. Check if PHP is already installed by running the command php -v in the terminal. If it is already installed, you can skip to step 4.

  2. Download the PHP package from the official website (

  3. Install the package by running the installer

  4. Test the installation by creating a file called "test.php" in your web server's document root (e.g. /Library/WebServer/Documents/) with the following contents:

  1. In your browser, navigate to "http://localhost/test.php" and you should see the PHP information page.

Watch a course Learn object oriented PHP

Note: This is a basic example and the exact steps may vary depending on the version of PHP and Mac OS X you are using.