Tuesday , 16 September 2014
Home » .htaccess » URL file-access is disabled in the server configuration – failed to open stream
URL file-access is disabled in the server configuration – failed to open stream

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

About Rakshit Patel

I am PHP Freelancer, Rakshit Patel AKA WordPress Freelancer working as PHP Programmer India. I am here to share all my developing knowledge, quick coding techniques, quick solutions to save your time and help you guys for any issue or bug fixing. If you have any PHP, WordPress, Magento related work, please contact me. I am interested for the work.

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>