Page 1 of 1

Getting errors with smarty php include

Posted: Sun Jan 07, 2007 5:21 pm
by Piata
I have a simple PHP include that lists the most recent forum posts from phpBB. Since my servers last SQL update, I get this string of errors:

Code: Select all

Warning: include(): URL file-access is disabled in the server configuration in /hsphere/local/home/lexingto/skatenewspot.com/templates/sns2/config.inc.php on line 5 Warning: include(http://www.skatenewspot.com/phpbb_frontpage.php): failed to open stream: no suitable wrapper could be found in /hsphere/local/home/lexingto/skatenewspot.com/templates/sns2/config.inc.php on line 5 Warning: include(): Failed opening 'http://www.skatenewspot.com/phpbb_frontpage.php' for inclusion (include_path='.:/hsphere/shared/apache/libexec/php5ext/php/:/hsphere/local/home/lexingto/skatenewspot.com/:/hsphere/local/home/lexingto/skatenewspot.com/bundled-libs/') in /hsphere/local/home/lexingto/skatenewspot.com/templates/sns2/config.inc.php on line 5
The code for the config.inc.php is about as simple as can be:

Code: Select all

<?php
$serendipity['smarty']->register_function('phpbb_frontpage', 'phpbb_frontpage');

function phpbb_frontpage($params, &$smarty) {
  include 'http://www.skatenewspot.com/phpbb_frontpage.php';
}
?>
Any help sorting this out would be greatly appreciated.[/code]

Posted: Mon Jan 08, 2007 3:26 am
by judebert
This line:
Warning: include(): URL file-access is disabled in the server configuration in /hsphere/local/home/lexingto/skatenewspot.com/templates/sns2/config.inc.php on line 5
Means that your config.inc, line 5, is violating a server policy: you're not allowed to access URLs as if they were files.

If that's on your local server, just remove the http://{domain}/ stuff, and it should work as expected.

If it's not on your local server, you'll have to convince your webhost provider to allow file wrappers in PHP. (Good luck with that.)

Posted: Tue Jan 09, 2007 6:18 am
by Piata
Ugh. Thanks. Never seen that error before so wasn't sure about it.