facebook

by on

Recent Comments

Articles

If PHP's file_get_contents Function is Failing With IIS 7

Very quick post here. So I moved my blog from a shared hosting account to my  windows VPS yesterday and everything worked perfectly except three php scripts I wrote to grab my facebook/twitter feeds and my recent comments from disqus. Since all three scripts use the file_get_contents script I assumed that was somehow the issue.

After some searching I decided to check if the allow_url_fopen parameter was set to yes in my server's php.ini file. Sure enough the parameter was set to off. After I changed the parameter in the ini file on my server to "on" all the scripts started working again. I thought I should make a blog post about it because I used Microsoft's Web Platform Installer to setup php on my vps and allow_url_fopen's default value was off. I am assuming this might catch a few other people off guard.

blog comments powered by Disqus