【问题标题】:WP ERROR: Warning: file_exists(): open_basedir restriction in effect. File(core/post-comments) is not within the allowed path(s)WP 错误:警告:file_exists():open_basedir 限制生效。文件(核心/评论后)不在允许的路径内
【发布时间】:2023-02-22 04:08:10
【问题描述】:

我的一个朋友正在运行一个 WordPress 网站,突然开始在管理页面上出现此错误。

警告:file_exists():open_basedir 限制生效。文件(核心/后 cmets)不在允许的路径内:(/data/web/virtuals/269369/virtual)在 /data/web/virtuals/269369/virtual/www/domains/mfproductions.cz/ wp-includes/blocks.php 第 532 行

托管服务提供商不允许禁用 open_basedir。

谁能帮忙?

【问题讨论】:

    标签: wordpress warnings open-basedir


    【解决方案1】:

    这个解决方案对我有用。

    在第 532 行的文件 wp-includes/blocks.php 中更改此内容:

    if (is_string( $block_type ) && file_exists( $block_type ) ) {

    对此: if ($block_type != "core/post-comments" && is_string( $block_type ) && file_exists( $block_type ) ) {

    然后我会建议您更新所有插件和 WP 核心并撤消更改。我觉得会没事的。 :)

    【讨论】:

    • 因此,更改代码以避免 $block_type 为“core/post-cmets”时的情况有效。但是在更新插件(WP 已经是最新版本)并逆向代码后,问题仍然存在。但是谢谢你的临时解决方案。我会在 WP 获得更新后尝试撤消它
    【解决方案2】:

    非常感谢!

    我在您的网站上解决了这个问题,您的建议非常有帮助。

    祝你今天过得愉快。 卡雷尔基利安

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-11
      • 1970-01-01
      • 1970-01-01
      • 2019-08-07
      • 1970-01-01
      • 1970-01-01
      • 2020-12-21
      • 2010-12-23
      相关资源
      最近更新 更多