Hello,
I am having a problem with fopen on ONE of my servers. It works fine on all my other ones.
When i try to open a url in fopen, to check if it exists or not, it always returns true. It doesnt register the 404 like its supposed to.
Here is the test file i am using:
I have this file reading the stream of fopen and outputting it to the browser.
http://pvt-test.tooshocking.com/fopentest.php
If you notice it just grabs the 404 page instead of returning an error like the same code does on this server
http://media2.evilchili.com/adengage/fopentest.php
I can't find any information on why this would be doing this.
Can anyone here help me fix this?
here is the code i am using to test
<?php
$fp = fopen("http://media2.evilchili.com/content/blogs/pictures/Desert%20Landscape.jpg", "rb");
$file = fread($fp, 4096);
fclose($fp);
if($fp)
{
echo "FILE";
}
else
{
echo "NO FILE";
}
echo $file;
?>