PHP Include

Status
Not open for further replies.

memoryz

New Member
Messages
28
Reaction score
0
Points
0
Okay, so I've been using SMF, and recently looked at the SSI thing.

It uses the PHP Include, so I tried this out.

I added
Code:
<?php require("/home/******/public_html/forums/SSI.php"); ?>

To the top of my index page, then put in
Code:
<?php ssi_recentTopics(); ?>

Now, when I go to my page, I get these errors:

Warning: require() [function.require]: URL file-access is disabled in the server configuration in /home/*****/public_html/partie/index.php on line 1

Warning: require(http://*******/forums/SSI.php) [function.require]: failed to open stream: no suitable wrapper could be found in /home/*******/public_html/partie/index.php on line 1

Fatal error: require() [function.require]: Failed opening required 'http://********/forums/SSI.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*******/public_html/partie/index.php on line 1

Just wondering, is PHP Include disabled..?
 

adamparkzer

On Extended Leave
Messages
3,745
Reaction score
81
Points
0
PHP include is not disabled, you're just using it wrong :p

You shouldn't include the home/username/public_html in your relative URL. For example, if you're loading the SSI.php page from within the forums folder, all you need is require("SSI.php").
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Code:
<?php require[B]("/home/******/public_html/forums/SSI.php[/B]"); ?>


Code:
Warning: require() [function.require]: URL file-access is disabled in the
 server configuration in /home/*****/public_html/partie/index.php on line 1
 
Warning: require([URL]http://*******/forums/SSI.php[/URL]) [function.require]: failed to 
open stream: no suitable wrapper could be found in 
/home/*******/public_html/partie/index.php on line 1
 
Fatal error: require() [function.require]: Failed opening required 
[B]'http://********/forums/SSI.php'[/B] 
(include_path='.:/usr/lib/php:/usr/local/lib/php') 
in /home/*******/public_html/partie/index.php on line 1

Something doesn't match up. In the first one you required an absolute path and the second is saying you required a webpage. Did you change something? Are you sure you spelled your username correctly in the first require?





PHP include is not disabled, you're just using it wrong :p

You shouldn't include the home/username/public_html in your relative URL. For example, if you're loading the SSI.php page from within the forums folder, all you need is require("SSI.php").

Adam, you can use an absolute path in include/require. He is not loading it from the forums directory.
 
Status
Not open for further replies.
Top