不能在php中包含文件

I am running the code below in some if/else statements, I have a weird issue in the same file this exact code below works fine, however in another area if it is called I get this error;

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;

And just to clarify I am njot trying to run this code 2 times at the SAME time, it's more like this; Not just like this but you get the point that they are not run at the same time

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

If it matters, I am currently running a LAMP setup on a windows PC

remove the "http://localhost" part of your code. As a rule of thumb, when you include your own files, you should include them from your file system.

include "./index.php";

Well, I don't kow the answer to your question, though I do have to ask why you feel the need to include a URL based file?

include('http://whatever.com/'); can be EXTREMELY dangerous.

If you're just trying to output the HTML generated from that, I'd suggest you do something like echo file_get_contents('http://some/url');. If you're trying to include PHP code, use the system path

Just remove the http://localhost/ part and you'll be okay.

Are they EXACTLY the same? Could you post both versions of the code?

I can also recommend not doing an include('http://...'); This will make PHP to an HTTP request to your webserver, and grab the result. You might be a bit better off just doing include('index.php');, if this is possible for your setup.

Is allow_url_fopen enabled in php.ini?