wp-cli displays php notices when display errors off

First, you have to do your PHP error settings in your php.ini file unless the PHP ini directives don’t list it as PHP_INI_ALL – which is the case for nearly error related definition.

So I’m assuming you just misread something and set stuff to wp_settings.php instead of wp-config.php.

The next point is that WP CLI might run WP in different cases without some stuff loaded, so it could get bypassed.

The safest point to set some php.ini stuff always is your php.ini file. And if you can’t work around errors: Go and fix them – that’s what errors, warnings and notices are for. If it’s a plugin causing it, send a pull request and notify the author.


Note: If you are in/on your Terminal/Command Line, you can use php --ini to list all locations where your php.ini files are stored. Some operating systems support different locations per default. And some packages like XDebug have additional locations per default.

Example php --ini result on Windows:

Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File:         C:\dev\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

Example php --ini result on Ubuntu 12.04 LTS:

Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed:      /etc/php5/cli/conf.d/05-opcache.ini,
/etc/php5/cli/conf.d/10-pdo.ini,
/etc/php5/cli/conf.d/20-curl.ini,
/etc/php5/cli/conf.d/20-gd.ini,
/etc/php5/cli/conf.d/20-json.ini,
/etc/php5/cli/conf.d/20-mysql.ini,
/etc/php5/cli/conf.d/20-mysqli.ini,
/etc/php5/cli/conf.d/20-pdo_mysql.ini,
/etc/php5/cli/conf.d/20-readline.ini,

Leave a Comment