php Error failed to open stream: HTTP request failed!

1. Change Php.ini to allow_url_fopen and change allow_url_fopen = On
2. But sometimes there is a warning, and you have to set the user_agent in PHp.ini. The default user_agent in PHP is PHP. MSIE 6.0; Windows NT 5.0) to simulate the browser
user_agent = “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)”

Read More: