If PHP's allow_url_fopen
ini directive is set to true, and if curl
doesn't work either (see this answer for an example of how to use it instead of file_get_contents
), then the problem could be that your server has a firewall preventing scripts from getting the contents of arbitrary urls (which could potentially allow malicious code to fetch things).
I had this problem, and found that the solution for me was to edit the firewall settings to explicitly allow requests to the domain (or IP address) in question.