URL file-access is disabled in the server configuration

When opening external URL’s through PHP, you might stumble upon the dreaded “URL file-access is disabled in the server configuration”-error message.

It just means that remote access was disabled in the server configuration, so you can’t load external files (say: images, text files, xml files, …).

You can’t fix this from inside your script: allow_url_fopen is an INI_SYSTEM directive, so ini_set() at the top of your page won’t change it. It has to be set in the php.ini file, maintained by your server administrator.

/*;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files. */
allow_url_fopen = On

In most cases however, this won’t be allowed. You could try functions such as file_get_contents() , and parse the result afterwards – to have a similar working method such as fopen() .