Thursday , 23 March 2017
Home » .htaccess » Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration
Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration

Hello Friends,

I have worked on many PHP projects and clients are happy with work as well. Suddenly yesterday I got an email from my client about the issue. He was a little angry and saying that why it stops showing Google Map on my contact us page. It was showing below error message.

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration /public_html/GoogleMapAPI.class.php.

I know it is very easy to understand why it throws this error. It is showing this error means allow_url_fopen is off on the server. This may be action taken by hosting people for security. I try with below options to get it works. But none of the options works for me. I told him to contact hosting people to get this on. You may try below options to make it enable.

Option – 1 [.htaccess]

php_value allow_url_fopen On

Option – 2 [PHP Code]

ini_set('allow_url_fopen',1);

Option – 3 [php.ini] If you have php.ini access in your hosting control panel than edit it and make sure that allow_url_fopen is on. If it is off than make it on.

If you dont have access to php.ini file than create php.ini file in root level, put below line and save it.

allow_url_fopen = on;

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration, URL file-access is disabled, URL file-access is disabled .htaccess, URL file-access is disabled in php, make allow_url_fopen on using .htaccess, allow_url_fopen on using php.ini will be solved using above solutions.

      
Plugin by: PHP Freelancer

About Rakshit Patel

I am PHP Freelancer, Rakshit Patel working as PHP Programmer India. I have developed this site to share my knowledge, thoughts and experience during the development of projects. We are group of developers working together. If you want to hire us for any PHP related work, you can reach me via Email, Phone or Chat.

Leave a Reply

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

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.