不能在php中包含文件

Jas*_*vis 3 php

我在一些if/else语句中运行下面的代码,我在同一个文件中有一个奇怪的问题,下面这个确切的代码工作正常,但是在另一个区域,如果它被调用我得到这个错误;

Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:\webserver\htdocs\processing\process.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:\webserver\htdocs\processing\process.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;
Run Code Online (Sandbox Code Playgroud)

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

if(something){
   run the code above
}else{
   run the code above
}
Run Code Online (Sandbox Code Playgroud)

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

Rob*_*ner 10

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

include "./index.php";
Run Code Online (Sandbox Code Playgroud)

  • 由于您的普遍支持,对您的回答和评论进行了评价.=) (2认同)