gaza165 Posted October 26, 2008 Share Posted October 26, 2008 I am trying to reference an include to the root of my server to access the PEAR framework and the BBCodes folder inside it. For some reason it cannot seem to access the correct folder on the webserver. Any ideas would be great... <?php include_once "init.inc.php"; if (!empty($_POST['text'])){ echo '<div style="border: solid 1px orange; padding:20px; margin: 20px">'; require_once 'HTML/BBCodeParser.php'; $parser = new HTML_BBCodeParser(); $parser->setText($_POST['text']); $parser->parse(); echo $parser->getParsed(); echo '</div>'; } ?> then init.inc.php looks like this <?php // figure out the if ":" or ";" should be used for ini separators if (strpos(strtoupper(PHP_OS), "WIN") !== false) { define("INI_PATH_SEPARATOR", ";"); } else { define("INI_PATH_SEPARATOR", ":"); } // add PEAR to the path ini_set( "include_path", ini_get("include_path") . INI_PATH_SEPARATOR . realpath("PEAR") ); // stripslashes as shown on http://php.net/get_magic_quotes_gpc if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } ?> this is the error i get... Warning: require_once(HTML/BBCodeParser.php) [function.require-once]: failed to open stream: No such file or directory in /home/thedesig/public_html/blog_files/blogmore.php on line 111 Fatal error: require_once() [function.require]: Failed opening required 'HTML/BBCodeParser.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/thedesig/public_html/blog_files/blogmore.php on line 111 Link to comment https://forums.phpfreaks.com/topic/130153-problem-referencing-server-root/ Share on other sites More sharing options...
mtylerb Posted October 26, 2008 Share Posted October 26, 2008 You said that HTML is in the root directory? Then shouldn't it be: <?php require_once '/HTML/BBCodeParser.php'; ?> I think... Link to comment https://forums.phpfreaks.com/topic/130153-problem-referencing-server-root/#findComment-674937 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.