0

In my php.ini file I have the following line set:

error_reporting = E_ALL

display_errors is also turned on in the ini file.

However, this does not appear to be working correctly because I can only get PHP to display strict errors when I add the following to my PHP file:

ini_set('display_errors', 1);
error_reporting(-1);

I'm using Wampserver, why is this happening? I want PHP to display all errors no matter what the severity without having to include this code in every file.

kjdion84
  • 9,552
  • 8
  • 60
  • 87

1 Answers1

0

WAMPServer, has 2 php.ini files

In the \wamp\bin\php\php{version}\ folder. This controls ONLY PHP CLI.

If you want to effect the Apache web server environment you should always use the menus to get to the correct file, as it changes as you change Apache/PHP versions

So

left click wampmanager->PHP->php.ini

and this will edit the correct file for the current Apache/PHP activated.

But by default error reporting and XDEBUG should be turned on

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • XDEBUG is turned on and it is showing non-strict errors. I am trying to get it to show errors such as when undeclared variables are used. I have `error_reporting = E_ALL` in the PHP file you mentioned when I click the wamp manager and go to `PHP->php.ini`. Do I need to add E_STRICT? Like I said I thought this was included in 5.4. – kjdion84 Jan 30 '17 at 13:25
  • Are you running code you have written, or are you fixing someone elses code that you are not familiar with – RiggsFolly Jan 30 '17 at 13:27
  • I'm running code I have written and I don't want there to be any errors because sometimes a non-strict error occurs which breaks the page and I have absolutely no idea why until I manually add the code I mentioned in OP. – kjdion84 Jan 30 '17 at 13:32
  • I think maybe the problem is that I need to enable non-strict error reporting? Sorry for being so confusing it's been a long night. – kjdion84 Jan 30 '17 at 13:32
  • Just a possibility! I dont suppose you have turned any error reporting off in your INIT functionality? – RiggsFolly Jan 30 '17 at 13:34