Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

URL file-access is disabled in the server configuration – failed to open stream

Hello Friends,

I was working with Google Map and I got warning message which says “Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration”. Also it shows me “[function.file-get-contents]: failed to open stream: no suitable wrapper could be found in GoogleMapAPI.class.php class”. If you are facing the same problem than I have couple of solutions for it. I hope one of them will works for you.

This error appears because allow_url_fopen is off on the server. You need to make it “on”. To make allow_url_fopen “on”, you can enable it using .htaccess, php code or php.ini file.

1. Using .htaccess
Put below line of code in your .htaccess file.

php_value allow_url_fopen On

2. Using PHP Code
ini_set(‘allow_url_fopen’, 1);

3. Using php.ini
allow_url_fopen = On;

URL file-access is disabled in Server, URL file-access is disabled, failed to open stream, fopen and file_get_contents is not working, file_get_contents + URL file-access is disabled, file_get_contents + failed to open stream, Enable allow_url_fopen, turn allow_url_fopen on using .htaccess



Leave a Reply

Your email address will not be published.