Search code examples
phpwampserver

PHP not showing all errors despite E_ALL being set


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.


Solution

  • 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