I want to read the response from a server from another server on user request for which I am using php file_get_content method
as
<?php
set_time_limit(0) ;
$url = "http://domain.com/function.php";
$response = file_get_contents($url);
echo $response;
?>
But in response I get an error as Warning: file_get_contents(http://domain.com/function.php) [function.file-get-contents]: failed to open stream:
Also I have updated the php.ini and made active the
Please let me know what steps I follow to resolve this issue.
You will probably be best off using cURL.
$ch = new curl_init('http://domain.com/function.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($ch);
curl_close($ch);