Categories
mac MAMP PHP Tutorials

How to turn display_errors to on in php.ini file

This is a quick tutorial that will walk you through turning display errors on in your php.ini file.

What green means: any lines that you need to replace in this tutorial will be in green.


1. Enable the php.ini file:

If you php.ini file is not enabled. The first thing you will want to do is enable it.

Here is a quick guide to setup and enable your php.ini file on a Mac with OSX

2. Update the error setting

1. Using Terminal open the php.ini file using the nano editor

sudo nano /etc/php.ini

2. Find the line display_errors = and change Off to On

press (ctrl and w) to open the search in nano. Enter display_error = and press enter

Update display_error = Off to display_error = On

3. Save and exit. Press (ctrl and x) to save and close the file.

3. Restart apache

1. Using Terminal type the following to restart apache

sudo apachectl restart

2. Enter your user password

And you are done. Your php.ini settings are now set to show errors.

By Jonathan Whiting

I enjoy sharing what I am learning and hopefully it's of interest and help to you. I live in Canada with my wife. Follow me on Twitter.

Leave a Reply

Your email address will not be published.