使用include包含外部文件时显示错误 [英] error is showing while using include to include an external file

查看:82
本文介绍了使用include包含外部文件时显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码包含外部文件 -



I use this code to include an external file -

<?php
include("http://vannmon.favcc1.com/index.php");
?>









但它显示这个错误 -



PHP警告:include():http://在服务器配置中禁用包装器by / web / com / 137604004711111 / main中的allow_url_include = 0 .php第2行PHP警告:include(http://vannmon.favcc1.com/index.php):无法打开流:在第2行的/web/com/137604004711111/main.php中找不到合适的包装器PHP警告:include():无法在/ web中打开http://vannmon.favcc1.com/index.php(include_path ='。:/ usr / share / pear:/ usr / share / php')第2行/com/137604004711111/main.php



我试图包含该文件的子域名是以我的名字注册的。如何纠正此错误?





but it is showing this error -

PHP Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /web/com/137604004711111/main.php on line 2 PHP Warning: include(http://vannmon.favcc1.com/index.php): failed to open stream: no suitable wrapper could be found in /web/com/137604004711111/main.php on line 2 PHP Warning: include(): Failed opening 'http://vannmon.favcc1.com/index.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /web/com/137604004711111/main.php on line 2

The sub-domain from which I'm trying to include the file is registered under my name. How can I rectify this error ?

推荐答案

除非修复PHP配置,否则无法修复它。如果您使用共享主机(看起来像),这是您的Web托管计划的政策。它限制了您的跨域PHP使用,即使对于同一域的子域也是如此。您所能做的就是要求您的Web托管客户服务更改策略和PHP配置文件。但是他们很容易拒绝帮助,因为这个PHP配置文件是共享的,他们不希望影响其他网站用户。无论如何,总是值得与他们讨论问题。



-SA
You cannot fix it unless you fix PHP configuration. If you are using shared hosting (it looks like), this is the policy of you Web hosting plan. It limits your cross domain PHP use even for the subdomain of the same domain. All you can do is to ask your Web hosting customer service to change the policy and the PHP config file. But they can easily deny help, just because this PHP config file is shared and they would not want to effect other site users. Anyway, it always worth discussing the problem with them.

—SA


这篇关于使用include包含外部文件时显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆