加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

不能在php中包含文件

发布时间:2020-12-13 21:59:53 所属栏目:PHP教程 来源:网络整理
导读:我在一些if / else语句中运行下面的代码,我在同一个文件中有一个奇怪的问题,下面这个确切的代码工作正常,但是在另一个区域,如果它被调用我得到这个错误; Warning: include() [function.include]: URL file-access is disabled in the server configuration i
我在一些if / else语句中运行下面的代码,我在同一个文件中有一个奇怪的问题,下面这个确切的代码工作正常,但是在另一个区域,如果它被调用我得到这个错误;

Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:webserverhtdocsprocessingprocess.friends.php on line 168

Warning: include(http://localhost/index.php) [function.include]: failed to open stream: no suitable wrapper could be found in C:webserverhtdocsprocessingprocess.friends.php on line 168

$_SESSION['sess_msg'] = 'Please Enter the Correct Security Code';
$_GET["friendid"] = $friendid;
$_GET["p"] = 'mail.captcha';
$_GET["f"] = 'friend';
include ("index.php");
exit;

只是为了澄清我在同一时间尝试运行此代码2次,它更像是这样;不只是这样,但你明白他们不是同时运行的

if(something){
   run the code above
}else{
   run the code above
}

如果重要,我目前正在Windows PC上运行LAMP设置

解决方法

删除代码的“ http://localhost”部分.根据经验,当您包含自己的文件时,应该从文件系统中包含它们.

include "./index.php";

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读