I am trying to open an XML file in remote server through fopen() function. I have two remote servers and the file permission of the xml is set to 777 in both servers. i am able to open the xml from one server , but not from other. Both files can be opened in browser.
What all permission i need to set or what parameters i need to set in fopen() function.?
this is the function
function getFileData($ProjectName)
{
$file = fopen($ProjectName, "r") or exit("Unable to open File! ".$ProjectName);
$fileContent="";
while(!feof($file))
{
$fileContent.=fgets($file);
}
fclose($file);
echo $fileContent;
}
getFileData('http://serverA.com/myxml.xml'); // gives the content
getFileData('http://serverB.com/myxml.xml'); // gives the error fopen(http:/serverB.com/myxml.xml) [function.fopen]: failed to open stream: HTTP request failed!