jamesjmann Posted February 6, 2011 Share Posted February 6, 2011 I just installed the simple machines forum on my website and began adding functions to my main website like code that displays the number of members online. This is my problem: This, <?php require("SSI.php"); ?> is supposed to go at the very top (line 1) of the document(s) displaying such functions. I get it to work on all documents in the root directory, by specifying the location of "SSI.php" as is above. But when I try putting this code at the top of a document in a subdirectory (e.g., www.website.com/sub/documentwithcode), I get this error: Warning: require_once(/home/content/d/j/s/djsmiley/html/music/Settings.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/d/j/s/djsmiley/html/music/SSI.php on line 49 Fatal error: require_once() [function.require]: Failed opening required '/home/content/d/j/s/djsmiley/html/music/Settings.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/d/j/s/djsmiley/html/music/SSI.php on line 49 This error occurs when I specify the location of the "SSI.php" file like this: <?php require("forum/SSI.php"); ?> and makes no difference when specified like this (even with the "SSI.php" file in the same directory as the document within the subdirectory) <?php require("SSI.php"); ?> Please note that the "SSI.php" file is supposed to be here: http://www.website.com/forum/SSI.php I tried copying it into each subdirectory, but that didn't do anything. Does anyone know how to fix this? Quote Link to comment Share on other sites More sharing options...
lastkarrde Posted February 6, 2011 Share Posted February 6, 2011 Relative imports. Pass the full file system path to the SSI file. <?php require("/home/username/www/blah/forum/SSI.php"); ?> Quote Link to comment Share on other sites More sharing options...
jamesjmann Posted February 6, 2011 Author Share Posted February 6, 2011 Relative imports. Pass the full file system path to the SSI file. <?php require("/home/username/www/blah/forum/SSI.php"); ?> That worked, THANKS! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.