我刚刚开始在我正在研究的网站的前端和后端(使用Wordpress)收到一些警告.使用error_reporting(0)关闭错误报告;放在wp-config.php文件的开头.我试图将它放入主index.php文件中,但无济于事.
这些警告今天才开始出现,并且它们没有显示在网站的实时版本上,这是至少99%相同的代码,相同的数据库.
以下是错误(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
为什么我会收到这些消息?不应该error_reporting(0)关闭所有警告?
解决方法:
尝试:
ini_set("display_errors", "off");
但是,根据您的主机,您可能无法动态更改这样的设置.