URL file-access is disabled in the server configuration

I've recently upgraded Apache and PHP on my VPS, and one of the unpleasant surprises was that some scripts which tried including pages from remote sites (I know, not the most secure approach, but there were reasons for that) got broken.

allow_url_fopen

Traditionally, all the websites Google finds suggest that you double-check that your php.ini config has the allow_url_fopen enabled:

allow_url_fopen = On

Well, in my case it was enabled, but scripts were still broken. The really weird thing was that the upgrade procedure didn't include changing the php.ini in any way, so it was fully working before and I kind of expected it to continue working.

allow_url_include

After some quick research, I've found out that PHP 5.1 introduced a new security option to accompany the allow_url_fope, and this was exactly the option which broke my scripts:

allow_url_include = On

There you have it, hope it helps you next time you come across this problem!

Please share:
  • Digg
  • del.icio.us
  • Netvouz
  • BlinkList
  • Fark
  • Furl
  • kick.ie
  • Netscape
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb

4 comments ↓

#1 Nate Smith on 02.09.09 at 10:50 am

Thanks – that actually did fix my problem – just wanted to you know that at least one person was helped…

#2 Gleb Reys on 02.09.09 at 11:23 am

Great to hear that, Nate! Thanks for stopping by!

#3 felix on 04.06.09 at 5:12 pm

I change code in the php.ini from allow_url_fopen = On to allow_url_include = On, but still it did not work for me.

#4 Tim on 08.29.09 at 10:43 pm

This saved my bacon, thank you! And I learned something which is even better.

Leave a Comment