This test script is designed to check whether the PHP fopen() function works on the server.
<?php
function get_content(){
$link = "http://google.com/";
$fd = fopen($link, "r");
$text="";
if ($fd == false) echo "Requested page not found 11";
else { while (!feof ($fd)) $text .= fgets($fd, 4096);
}
fclose ($fd);
echo $text;
}
get_content();
The script will run successfully if two conditions are met:
- The server has open connections to external resources (port 80, http://google.com/)
- The PHP fopen() function is present and allowed