Monday, December 13, 2010

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

I too, was getting the error:

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

For my include file.

Using "Allow_url_include = On" in my php.ini file was not an option for me, since I was using a cpanel on some third part web host. (Allow_url_include is kind of a bad thing to do anyway, since it means other hosts can link to your file and steal your code).

However, this site taught me how to solve it: http://blog.everymanhosting.com/php-coding/warning-include-functioninclude-url-file-access-is-disabled-in-the-server-configuration/

The option that worked for me was:

require_once($_SERVER['DOCUMENT_ROOT'].'/file.php');

No comments:

Post a Comment