PHP warnings even though error reporting is disabled

I just started getting some warnings on both the front and the back (using Wordpress) of the site I'm working on. Error reporting is disabled using error_reporting(0); placed at the beginning of the wp-config.php file. I tried to put it in the main index.php file, but to no avail.

Warnings have just begun to appear today, and they do not appear in the live version of the site, which is at least 99% of the same code, the same database.

Here are the errors (submenu name domain.com):

Warning: is_dir () [function.is-dir]: current open_basedir restriction. File (/) is not included in the valid paths: (/var/www/virtual/domain.com/:/usr/share/php/) in /var/www/virtual/domain.com/htdocs/wp -includes / functions .php on line 2104

Warning: file_exists () [function.file-exists]: current open_basedir restriction. File (/) is not included in the valid paths: (/var/www/virtual/domain.com/:/usr/share/php/) in /var/www/virtual/domain.com/htdocs/wp -includes / functions .php on line 2095

Warning: is_dir () [function.is-dir]: current open_basedir restriction. File (/) is not included in the valid paths: (/var/www/virtual/domain.com/:/usr/share/php/) in /var/www/virtual/domain.com/htdocs/wp -includes / functions .php on line 2104

Why am I receiving these messages? Should error_reporting(0) disable all warnings?

+4
source share
4 answers

OK, so I solved the problem directly by modifying the php.ini file. This is the line:

 php_admin_value open_basedir none 

Thanks @halfer

+2
source

Some of the commentators do not seem to know how Wordpress sets up a bug report. It is said that things like β€œto be done” are this or that. But the fact in Wordpress all you have to do is go to wp-config.php and change WP_DEBUG from true to false. This will do exactly what you want.

+2
source

Try:

 ini_set("display_errors", "off"); 

However, depending on your host, you may not have access to dynamically changing ini settings.

+2
source

In wordpress, you can enable error reporting only with the following lines of code:

 define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); @ini_set('display_errors', 0); 
+2
source

All Articles