我收到以下 2 个错误:
警告:file_get_contents() [function.file-get-content]:在服务器配置中禁用了 URL 文件访问 /home/content/.../wp-content/themes/mytheme/functions.php 在第 4035 行
警告:file_get_contents(http://www.mysite.net/...y-1.7.2.min.js) [函数.文件获取内容]:无法打开流:不合适 包装器可以在 /home/content/.../html/wp-content/themes/mytheme/functions.php on online 4035
这是第 4035 行
$myFile=file_get_contents(get_bloginfo('template_directory')."/js/jquery-1.4.2.min.js");
这只是服务器上的权限问题吗?如何包装此函数以防止错误并退出有用的消息?
您需要
在 php.ini 配置文件中启用 allow_url_fopen
和allow_url_include
(如果您想使用 include
加载远程资源)。另外,您可以尝试将其添加到.htaccess
但我认为如果您将 php 作为 apache 模块运行,它不起作用 - 它不应该覆盖此设置......
php_value allow_url_fopen On