One of my websites on a shared host has started behaving strangely. The file() function won't work when calling a URL. Here is what I tried, straight from php.net/function.file.
PHP Code:
start
<?
// Get a file into an array. In this example we'll go through HTTP to get
// the HTML source of a URL.
$lines = file('http://www.mendhak.com/default.aspx');
?>
finish
The page comes out as blank for any URL. It gives an HTTP 200, but there is no markup at all when viewing source. Is there a way to make the page not depend on what's coming back from the HTTP request? I've also tried a try catch, still blank response.
PHP Code:
start
<?
try
{
// Get a file into an array. In this example we'll go through HTTP to get
// the HTML source of a URL.
$lines = file('http://www.vbforums.com/index.php');
}
catch(Exception $e)
{
echo ('exception');
}
?>
finish
The server is using PHP 5.2.5.
Another question - I can do a phpinfo(), but is there anything in phpinfo() that I can look at to see whether such web requests are allowed or not?