尽管错误报告被关闭,PHP 警告

标签 php wordpress

我刚开始在我工作的网站的前端和后端(使用 Wordpress)收到一些警告。使用位于 wp-config.php 文件开头的 error_reporting(0); 关闭错误报告。我也尝试将其放入主 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");

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

关于尽管错误报告被关闭,PHP 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14643878/

相关文章:

php - WordPress - 使 WordPress 评论可供外部内容使用

javascript - 无符号右移函数不适用于负输入

php - 如何在 laravel-dompdf 中设置景观?

javascript - 使用 Angular/PHP 将 JSON 对象插入 MySQL 表

wordpress - 如何获得woocommerce中最受欢迎产品的类别列表

css - 我在我的菜单项的伪元素中使用 unicode,是否可以仅从第一个菜单项中删除它?

javascript - 如何在 AngularJS 部分文件中使用 php (wordpress) 函数?

css - 小屏幕上的背景图像模糊(在 Wordpress/Chrome 编辑器中看起来不错,但在实际手机上它很模糊

php - 图像上传与形式发送内容

php - 如何将CSS类应用于上传的图片?