Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1315318
Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 4 years ago.
Improve this questionI'm running WP CLI 0.25.0 on Debian, PHP 7.0. I keep getting the PHP warnings displayed. In php.ini used for cli I have set error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING
(and checked the change), but no difference, the warning is output.
Ran WP CLI with --debug=false
, still no effect.
How to suppress the warning display, as it breaks the JSON output ?
Edit 1
Before using error_log = Off :
PHP Warning: Invalid argument supplied for foreach() in /var/.../theme-settings.php on line 2805
Warning: Invalid argument supplied for foreach() in /var/.../theme-settings.php on line 2805
Using error_log = Off :
Warning: Invalid argument supplied for foreach() in /var/.../theme-settings.php on line 2805
Pay attention that the PHP Warning
disapeared, and theres the Warning
left.
Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 4 years ago.
Improve this questionI'm running WP CLI 0.25.0 on Debian, PHP 7.0. I keep getting the PHP warnings displayed. In php.ini used for cli I have set error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING
(and checked the change), but no difference, the warning is output.
Ran WP CLI with --debug=false
, still no effect.
How to suppress the warning display, as it breaks the JSON output ?
Edit 1
Before using error_log = Off :
PHP Warning: Invalid argument supplied for foreach() in /var/.../theme-settings.php on line 2805
Warning: Invalid argument supplied for foreach() in /var/.../theme-settings.php on line 2805
Using error_log = Off :
Warning: Invalid argument supplied for foreach() in /var/.../theme-settings.php on line 2805
Pay attention that the PHP Warning
disapeared, and theres the Warning
left.
1 Answer
Reset to default 1The first thing to check for this issue is the WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY constants in the wp-config.php file. They have to be set to false or be commented out (the default value is false). Else, no matter which global log_errors, display_errors or error_reporting settings you have, you will still see those warnings when running wp-cli.
本文标签: wp cliPHP warning are displaying when using WP CLI
版权声明:本文标题:wp cli - PHP warning are displaying when using WP CLI 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741976936a2408179.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
log_errors = Off
and it helped ! – Marin Bînzari Commented Nov 28, 2016 at 7:42--quiet=true
didn't help :( – Marin Bînzari Commented Nov 28, 2016 at 7:43