微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

尽管错误报告被关闭,但PHP警告仍然存在

我刚刚开始在我正在研究的网站的前端和后端(使用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");

但是,根据您的主机,您可能无法动态更改这样的设置.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐