TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Gotta love errors... Help out with require problem? (http://www.talkphp.com/general/2540-gotta-love-errors-help-out-require-problem.html)

Aaron 03-28-2008 08:30 AM

Gotta love errors... Help out with require problem?
 
Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in /home/<snip>/public_html/index.php on line 1

Warning: require_once(http://aetherdesigns.com/include/func_lib.php) [function.require-once]: failed to open stream: no suitable wrapper could be found in /home/<snip>/public_html/index.php on line 1

Fatal error: require_once() [function.require]: Failed opening required 'http://aetherdesigns.com/include/func_lib.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/<snip>/public_html/index.php on line 1

the error happens because I am giving the script an absolute path to the include file... Which is kinda lame because If the path is relative I need to change it for every file.

Nor 03-28-2008 11:25 AM

There isn't an error, that means you can include complete "urls" in your inclusion path.

If its a complete domain from a different server good luck, its disabled on about all new servers. Try:

PHP Code:

require_once("./include/func_lib.php"); 


Aaron 03-28-2008 06:07 PM

That means that I need to edit the includes on different files, which is like... a lot of work when the site gets bigger... :(

Is there any way around this?

freenity 03-28-2008 06:16 PM

you can change it through php.ini
I don't know what option exactly it is, but have a look at it it's well comented.

freenity 03-28-2008 06:26 PM

I just found something:

Quote:

allow_url_fopen = On
allow_url_include = On
Add these to your php.ini or set them to On if they were Off

Aaron 03-30-2008 03:01 AM

I found a shinier way.
PHP Code:

@include('$_SERVER["DOCUMENT_ROOT"]./include/func_lib.php'); 



All times are GMT. The time now is 12:32 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0