Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've turned on errors in php.ini by removing the ; in front of the comment on line 240 of php.ini (I'm using PHP 5.4.4).

I'm using MAMP for my local server to set up a local environment, and I changed the php.ini settings in Applications > MAMP > bin > php5.4.4 > conf > php.ini (this is on OS X 10.8).

I'm still getting blank screen errors when my PHP is wrong, which is quite often, as I've just started with it. Is this the right place / way to set the errors?

share|improve this question
Please include the actual line you uncommented. The line numbers will be different for different people. – terdon Jan 23 '13 at 19:05
@terdon the line is "E_ALL - All errors and warnings" – sam Jan 23 '13 at 20:16
OK, I see what is wrong. Have a look at my answer. You uncommented the wrong line. – terdon Jan 23 '13 at 20:28
up vote 1 down vote accepted

The line you have edited is a comment, not a directive. The PHP.ini file has a lot of information to help you out, most of it is only for you to read and not the computer.

You need to make sure that the following lines are not commented (have no ; at the beginning of the line) and have the correct values:

display_errors = On
html_errors = On
error_reporting = E_ALL

They will not necessarily be present and commented. On my system, for example, the display_errors line looked like this:

display_errors = Off

What you uncommented was a line explaining some of the PHP.ini options. It is there to explain to human users how to configure the file. Normal options have the format (note the =):

option_name = option_value

As you can see, the line you edited does not have that format. The equivalent line on my system looks like this:

; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 5.4.0)

Uncommenting that line will not help. In fact, I am surprised that PHP would work at all with it uncommented.

share|improve this answer
cheers @terdon ! – sam Jan 23 '13 at 20:38

Have you looked at this?

Enable PHP Error Reporting in MAMP | Gilbert Pellegrom

  • Open up /Applications/MAMP/bin/php/{your PHP version}/conf/php.ini.
  • Find display_errors = Off (around line 277) and change it to display_errors = On.
  • Restart MAMP.
share|improve this answer
Justin, please 1) don't address the OP by their name, 2) include the relevant parts of a link here, on-site, 3) don't post LMGTFY links and 4) don't sign your posts. Thanks. – slhck Jan 23 '13 at 17:52
My apologies sir @slhck – manumoomoo Jan 23 '13 at 17:57

The E_ALL in the php.ini is a default level for error reporting. This can be overridden by the function named "error_reporting" in a .php file. And if that file is run, or it's included from a running script, it will override the default level. You can search for the function "error_reporting" in those files and check that the level is not lower than E_ALL.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .