Novkovski Stevo Bato
Novkovski Stevo Bato

Reputation: 1043

Cant disable PHP warnings

Whatever i tried, i`m getting "Warning" messages when executing php script either via web server or cli.

My output on cli config:

php  -i | grep 'error'

display_errors => Off => Off
display_startup_errors => Off => Off
error_append_string => no value => no value
error_log => /var/log/php-7.0.log => /var/log/php-7.0.log
error_prepend_string => no value => no value
error_reporting => -32768 => -32768
html_errors => Off => Off
ignore_repeated_errors => Off => Off
log_errors => Off => Off
log_errors_max_len => 1024 => 1024
track_errors => Off => Off
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
intl.error_level => 0 => 0
opcache.error_log => no value => no value

But anyway, when i execute WP-CLI command i`m getting:

php  /usr/bin/wp-source --quiet  --path=$HOME/app/public_html  option get siteurl

Warning: Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given in /home/user/app/public_html/wp-includes/functions.php on line 3549
http://example.com

Upvotes: 1

Views: 713

Answers (2)

Matthew R.
Matthew R.

Reputation: 4350

PHP could be updating your settings at runtime. It would make your config up to that point pretty much useless. Open your directory in terminal or shell and do a grep for ini_set and error_reporting to see if any of your files are updating the config. Here is an example command you can run in your directory:

grep -rsi ini_set .

Upvotes: 0

Vural
Vural

Reputation: 8746

Open your php.ini and replace the line error_reporting with the code below

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING

Notices and warnings wont be displayed.

Upvotes: 1

Related Questions