Getting errors with smarty php include

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Piata
Regular
Posts: 7
Joined: Tue Sep 20, 2005 7:37 pm

Getting errors with smarty php include

Post 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]
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.)
Judebert
---
Website | Wishlist | PayPal
Piata
Regular
Posts: 7
Joined: Tue Sep 20, 2005 7:37 pm

Post by Piata »

Ugh. Thanks. Never seen that error before so wasn't sure about it.
Post Reply