Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP warnings despite error reporting being turned off

Tags:

php

wordpress

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

The warnings only started to show up today and they don't show up on the live version of the site, which is at least 99% the same code, same database.

Here are the errors (substituted domain name for domain.com):

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/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]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/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]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/virtual/domain.com/:/usr/share/php/) in /var/www/virtual/domain.com/htdocs/wp-includes/functions.php on line 2104

Why do I get these messages ? Shouldn't error_reporting(0) turn off all warnings?

like image 638
Mariano Grandioso Avatar asked Jul 03 '26 03:07

Mariano Grandioso


1 Answers

Some of the commenters don't seem to know how Wordpress sets error reporting. They say stuff like "should be done" like this, or that. But the fact is in Wordpress all you have to do is go to wp-config.php and change WP_DEBUG from true to false. That will do exactly what you want.

like image 156
C. E. Avatar answered Jul 04 '26 16:07

C. E.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!