That should look like:cd /private/etc/apache2/
Press enter and enter your password at the prompt.sudo nano httpd.conf
#). It should now look like this:
Then copy the default file provided from php.ini.default to php.inicd .. or cd /private/etc/
sudo cp php.ini.default php.ini
sudo nano php.ini
error_reportingto avoid a server a bit too chatty.The default setting looks like this:
This ensures that PHP reports all errors, but nothing more. Although no one likes error messages, it's vital to eliminate any errors (even seemingly minor ones) before deploying scripts on a live web server.
NOTE: There are several lines that look similar. Make sure that you edit the line that does NOT begin with a semicolon. A semicolon at the beginning of a line in
php.ini indicates a comment, which is ignored by the server.
Useful apachectl commands include:
- apachectl start
- apachectl stop
- apachectl restart
- apachectl -t