While accessing xml file with fopen
that don’t exist we get
failed to open stream: HTTP request failed!
But it takes 30 seconds. How to return this error immediately or short after not finding a file.
Also, why when file is not found Apache scans lots of ports?
I think this is the way, You have to use fopen itself to check whether it exists or not,
function fileExists($path){
return (@fopen($path,"r")==true);
}
if(fileExists('http://example.com/test/file.xml'))
{
echo "exists";
}
else
{
echo "not_exist";
}