Hi, I am trying to read the content of url. when manually i put url in browser
link : http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions it opens.
but using code
$homepage = file_get_contents('http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions'); echo $homepage;
Warning: file_get_contents( http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions ) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Unavailable in C:\xampp\htdocs\test.php on line 2
What is problem ? How to solve this?
Your server admin must have turned off fopen'ing of URLs.
Use cURL ( www.php.net/curl )
extension=php_curl.dll it's on (i.e. already remove ;)
CAn you please tell me what to do?
Post php.ini as attachment.
Hi, I posted php.ini as attachment.
To attach PHP.ini file it gives me error so i rename it to PHP-ini.php and then upload.
Plz help me to solve this..
Hi, I am trying to read the content of url. when manually i put url in browser link : http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions it opens. but using code $homepage = file_get_contents('http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions'); echo $homepage; Warning: file_get_contents( http://www.mvnforum.com/mvnforum/viewmember?member=pbmissions ) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Unavailable in C:\xampp\htdocs\test.php on line 2 What is problem ? How to solve this?
There is nothing wrong with your code. It is just the response from the server:
HTTP/1.1 503 Service Unavailable
That means that the server is unavailable. Usually this is a temporary error.
NB: if the allow_url_fope n setting is preventing http requests you'd get a: "http wrapper disabled etc.." error
hi,
any other way to read the html of url??
damn it. What happened to me that day when I was answering this thread lol.
Aamit, Your code is correct, but the server's down. You take any method to read HTML of URL be it file_get_contents or cURL, it can't help if the server is down.
Thanks Man I have the same problem now I know what was wrong thanks a alot man.
Just pass user agent like this in your CURL param
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
// set user agent curl_setopt($ch, CURLOPT_USERAGENT, $useragent);