PHP file_get_contents() returns “failed to open stream: HTTP request failed!” Problem : I am having problems calling a url from PHP code. I need to call a service using a query string from my PHP code. If I type the url into a browser, it works ok, but if I use file-get-contents() to make the call, I get: Warning: file-get-contents(http://.... ) failed to open stream: HTTP request failed! HTTP/1.1 202 Accepted in ... The code I am using is: $query=file_get_contents('http://###.##.##.##/mp/get?mpsrc=http://mybucket.s3.amazonaws.com/11111.mpg&mpaction=convert format=flv'); echo($query); Like

Solved : curl_init() function not working in Ubuntu Here solved the error Fatal error: Call to undefined function curl_init() You need to install CURL support for php. In Ubuntu you can install it via sudo apt-get install php5-curl If you're using apt-get then you won't need to edit any PHP configuration, but you will need to restart your Apache. sudo /etc/init.d/apache2 restart If you're still getting issues, then try and use phpinfo() to make sure that CURL is listed as installed. There is