1. Computing & Technology

Discuss in my forum

How to Install PHP on a Mac

By , About.com Guide

4 of 4

Testing PHP
Finally we need to run a test to make sure that PHP is running.

1.) First create a simple test file. A good thing to include is phpinfo(). Here is an example.

2.) If your PHP is working your test program should display your PHP's information. If it displays your code, you need to restart Apache.

You can restart Apache by entering the following line in Terminal:

sudo apachectl restart

Restarting will also require your password.

Congratulations, you have now activated PHP on your Mac, enjoy!

©2012 About.com. All rights reserved.

A part of The New York Times Company.