【问题标题】:How to resolve these warnings?如何解决这些警告?
【发布时间】:2012-11-15 06:16:14
【问题描述】:

我正在使用 WordPress 主题滑块,在此我使用了piecemaker。谁能帮帮我?

警告:include() [function.include]:URL 文件访问在 服务器配置在 ..wp-content\themes\TheProfessional\page-full.php 在第 8 行

警告: 包括(http://localhost/caterer/wp-content/plugins/theme-slider/wp-theme-slider.php) [function.include]:无法打开流:没有合适的包装器可以 可以在 ..wp-content\themes\TheProfessional\page-full.php 在线找到 8

警告:include() [function.include]:打开失败 'http://../wp-content/plugins/theme-slider/wp-theme-slider.php' 对于 包含 (include_path='.;Drive:\xampp\php\pear\') 在 ..\wp-content\themes\TheProfessional\page-full.php 在第 8 行

【问题讨论】:

  • 你读过那些警告了吗?他们提供了一个文件和一行来查看,除了错误的描述
  • 是的,我读过它,现在它在我给出路径后显示解析错误
  • 解析错误:第 18 行 \wp-content\themes\TheProfessional\page-sitemap.php 中的解析错误

标签: php wordpress


【解决方案1】:

您的指令 allow_url_include 已关闭,如果您可以控制您的主机,则需要在 php.ini 配置中打开它并重新启动 apache,如果您无法直接访问您的主机,您可以使用它wordpress 根文件夹中 index.php 文件顶部的代码以将其打开。

ini_set(‘allow_url_fopen’,'ON’);

如果没有任何效果 - 这是更详细的博客文章: additional information

【讨论】:

    【解决方案2】:

    这是因为包含使用 url (http://) 的文件是此错误背后的原因。您必须使用文件的目录路径而不是 url 路径来包含文件。由于文件来自某个插件和主题,因此将您的代码更改为此

    include(bloginfo('template_directory').'/page-full.php');
    include (WP_PLUGIN_DIR.'/theme-slider/wp-theme-slider.php');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-03
      • 1970-01-01
      • 2016-04-20
      • 1970-01-01
      相关资源
      最近更新 更多