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

htaccess-tricks-tips

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

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

Leave a Reply

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

Sponsors

Sponsors

Recommended

DHgate Computers
DHgate.com - Computers, Cell Phones & more
  • We find everbuying built in php and use css to control the style.

About Author

PHP Freelancer

PHP Freelancer I am PHP Freelancer, Rakshit Patel working as PHP Programmer India. I am here to share all my developing knowledge with you people. For Hire PHP Developer India, contact me.
Follow on twitter: @raxit4u2

Get Free Programming Tutorials:

Become a Fan

Popular Topics

Recent Posts

Most Popular

Recent Comments

Get a Free Quote
$
$
$
Security Question: 3 + 8 = ?
$