Cannot open any file using fopen() when specifying url.
Posted: 13. June 2008 05:07
I am trying to run a simple script such as:
$url='http://localhost/xampp/index.php';
//$url='c:\xampp\htdocs\index.php';
if (fopen ($url,"r"))
{
echo "It exists !!";
}
else
{
echo "It does not exist !!";
}
Error I get is :
[message] => fopen(http://localhost/xampp/index.php): failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
If I replace the url with 'c:\xampp\htdocs\index.php' it works fine.
Please help. Already spent one whole day on this.
$url='http://localhost/xampp/index.php';
//$url='c:\xampp\htdocs\index.php';
if (fopen ($url,"r"))
{
echo "It exists !!";
}
else
{
echo "It does not exist !!";
}
Error I get is :
[message] => fopen(http://localhost/xampp/index.php): failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
If I replace the url with 'c:\xampp\htdocs\index.php' it works fine.
Please help. Already spent one whole day on this.