While working with a 1and1.com hosted WordPress blog I hit a PHP error:
URL file-access is disabled in the server configuration
This error arises when
allow_url_fopen is set to “OFF” in the server’s php.ini file – which is the default value for (I believe) PHP 5. That setting controls your script’s access to the include and require statements and access to remote files. As such, there are certainly security concerns, so don’t follow my suggestion below until you understand if you really need it, why you need it, and that your script is safe and sanitizing data.
Just like my last Quick Tip for 1and1.com this is another quick fix, just a little different. If you manage your own server, just locate and edit the php.ini file. However, for folks using shared hosting (I suspect the majority) that’s not going to be an option.
However, you may be able to create your own “local” php.ini file. Add the following line:
allow_url_fopen = ON
Save the php.ini and upload it to the main directory of your site and test. For my 1and1 hosted app this worked instantly and solved my issues.
I’ve seen similar solutions that involve adding the following to the .htaccess file:
php_flag allow_url_fopen on
With 1and1, though, this only generates HTTP 500 errors and a busted app. However, it is definitely worth a shot on other hosting company servers.