Category: Others

How to enable URL file-access in the server configuration or Godaddy server

January 5, 2010 | Filed Under Others | 5 Comments

If you are getting Warning Messages like this one

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/xxxxxxxxxxxxxxxxxxxxxxxxxx/filecall.php on line 5

Where xxxxxxxxxxxxxxxxxxxxxxxxxx your server path.

It ‘s means that your server configuration is blocking external file access( include () function in many cases).

To solve this issue you need to set allow_url_fopen= ON and allow_url_include =ON in PHP configuration (php.ini).

If you have not dedicated server, You need to ask for your service provider to set allow_url_fopen= ON, allow_url_include =ON

If you want enable URL file-access setting=on via .htacess
then you need to write php_value allow_url_fopen 1 in .htacess file.
If you want to enable URL file-access via PHP.
Then you need to write   <?php
ini_set(’allow_url_fopen’,'ON’) ; // ON or 1 both are same
ini_set(’allow_url_fopen’,'ON’) ;
?>

I suggest a solution simple use file_get_contents() instead of include() function.
In this case you don’t need to enable URL file-accessin the server configuration.

Basically Godaddy server doesn’t support include() function due to disable allow_url_fopen.

Article written by admin

© PHPInterviewQuestion.com 2009 - 2010

eXTReMe Tracker