How can I switch off the output of Notices when debugging with PHPStorm
I would like to switch off the output of annoying notices to console, when debugging with phpstorm 6.0.3.
I've switched it of in php.ini:
error_reporting=E_ALL & ~E_NOTICE
but still a bunch of notices is printed to console, what makes debugging really slow.
Is there any specific settings option in PHP storm, that will allow me to switch this output of?
Thank you in advance for a replay
Please sign in to leave a comment.
Hi there,
Any example of such output, please?
It looks like the usual php output
Notice: Undefined offset: 4 in D:\wwwroot\myproject\Portal\library\lib.core.php on line 296
Notice: Undefined index: MYPROJECT in D:\wwwroot\myproject\Portal\library\lib.session.php on line 370
Notice: Undefined index: SETTINGS in D:\wwwroot\myproject\Portal\library\lib.session.php on line 399
Notice: Uninitialized string offset: 0 in D:\wwwroot\myproject\Portal\library\lib.core.php on line 397
Notice: Undefined index: MYPROJECT_MODULE_CODE in D:\wwwroot\myproject\Portal\library\lib.core.php on line 404
Notice: Undefined index: PORTAL_PATH in D:\wwwroot\myproject\Portal\library\lib.session.php on line 551
Notice: A session had already been started - ignoring session_start() in D:\wwwroot\myproject\Portal\library\class.portalsettings.php on line 300
Notice: Undefined index: PHPIDS in D:\wwwroot\myproject\Portal\library\IDS\Caching\Session.php on line 132
Notice: Uninitialized string offset: 0 in D:\wwwroot\myproject\Portal\library\lib.core.php on line 397
Notice: Undefined index: MYPROJECT_MODULE_CODE in D:\wwwroot\myproject\Portal\library\lib.core.php on line 404
Notice: Constant CONFIG_ORACLE_CHARSET already defined in D:\wwwroot\myproject\Portal\WPConfig.php on line 47
Notice: Undefined index: LOG_PERFORMANCE_INFO in D:\wwwroot\myproject\Portal\library\lib.database.php on line 368
But it is not present in php.log, as notices are switched off in php.ini.
This log appears just in phpStrom Console.
Can you advise me, how do I switch it off also for phpStorm?
TBH -- I do not know how this could be possible (notices in console despite php.ini settings).
My only thoughts:
In any case -- there is no option to suppress such output.
But you could use Grep Console plugin and configure some rules to make such notice messages much less visible (apply different color to such lines) or even completely remove such lines completely -- it works on PHP output/console as well.
I'm using Zend debugger, but I have not found any other setting property for it to suppress that output
Any other ideas how could I handle it?
I have this same problem, five years later. Note that these notices are properly filtered and handled in the application itself. They only show up when using a debugger in phpStorm (in my case it is xDebug and not Zend, so probably an issue with phpStorm.)
I confirmed that it is using correct php.ini. Actually, even if I call error_reporting(0); to turn off all error reporting, it still shows the notices in the console (even though phpinfo() output shows a zero for reporting level, and display_errors is off and even log_errors is off and display_startup_errors is off and xdebug.force_display_errors is off and xdebug.force_error_reporting is 0)
I found one workaround - to setup a custom error handler to handle notices etc.
Svemir, that's quite a lucky coincidence you mentioned it now and not earlier.
Here's a discussion on this matter, please vote for the request: https://youtrack.jetbrains.com/issue/WI-43921