Tandem Posted January 11, 2007 Share Posted January 11, 2007 I'm having all sorts of problems trying to set up HTML_BBCodeParser on a linux server via Shell.I've installed the package and got the structure of it right according to:http://www.sitepoint.com/article/bb-code-php-applicationI have got it working on my local server which runs on windows, so i'm probably doing something wrong to do with linux.Here is the code for my test script:[code]<?phperror_reporting(E_ALL);if (!empty($_POST['text'])){ require_once '/usr/share/pear/HTML/BBCodeParser.php';$parser = new HTML_BBCodeParser(parse_ini_file('BBCodeParser1.ini'));$parser = new HTML_BBCodeParser(); echo $parser->qParse(htmlspecialchars($_POST['text']));}?><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <textarea name="text" style="width: 300px; height: 200px"><?php echo @$_POST['text']; ?></textarea> <br /> <input type="submit" /> </form>[/code]Can anyone spot anything that i'm doing wrong from this?Or if thats right can anyone suggest anything else i might be doing wrong? I will be happy to provide anything you may need to know in order to help me.You can test my test script at http://217.174.251.128/testbb.php, which at the moment is producing complete nothingness.Thanks in advance for any help. Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/ Share on other sites More sharing options...
trq Posted January 11, 2007 Share Posted January 11, 2007 Never worked with HTML_BBCodeParser, but ide try removing this line....[code=php:0]$parser = new HTML_BBCodeParser();[/code]if you need to specify an ini to parse. Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-158667 Share on other sites More sharing options...
Tandem Posted January 11, 2007 Author Share Posted January 11, 2007 Thanks for the reply. I've changed it but unfortunately it still does the same. Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-158675 Share on other sites More sharing options...
trq Posted January 11, 2007 Share Posted January 11, 2007 [quote]I've changed it but unfortunately it still does the same.[/quote]Which is? Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-158682 Share on other sites More sharing options...
Tandem Posted January 11, 2007 Author Share Posted January 11, 2007 Just a totally blank screen is generated. You can test it at the link at the bottom of the original post. Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-158691 Share on other sites More sharing options...
Tandem Posted January 11, 2007 Author Share Posted January 11, 2007 I have the same code running on my local server but in a windows platform and it's working perfectly, so i'm guessing it's something to do with the code environment or some settings of some sort...Would be grateful for any other suggestions. Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-158740 Share on other sites More sharing options...
trq Posted January 12, 2007 Share Posted January 12, 2007 Sorry, thats just some freaky thing. At very least, the form should always display.To be honest, I don't see anything in particular wrong with your code. There must be something within the HTML_BBCodeParser that is (maybe throwing an error and then) exiting the script.Is there any is_error() method or something of the sort? Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-158770 Share on other sites More sharing options...
Tandem Posted January 13, 2007 Author Share Posted January 13, 2007 I've managed to get errors to appear after some adjusting of php.ini...Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/usr/share/pear/HTML/BBCodeParser.php) is not within the allowed path(s): ...Warning: require_once(/usr/share/pear/HTML/BBCodeParser.php) [function.require-once]: failed to open stream: Operation not permitted in ...Fatal error: require_once() [function.require]: Failed opening required '/usr/share/pear/HTML/BBCodeParser.php' (include_path='.:/usr/share/pear') in ...Does that help at all? Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-159610 Share on other sites More sharing options...
trq Posted January 13, 2007 Share Posted January 13, 2007 What does this produce?[code=php:0]echo get_include_path();[/code] Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-159613 Share on other sites More sharing options...
Tandem Posted January 13, 2007 Author Share Posted January 13, 2007 That produces .:/usr/share/pearI changed the require_once path to include the .: and now the first error message is gone and i'm left with: Warning: require_once(.:/usr/share/pear/HTML/BBCodeParser.php) [function.require-once]: failed to open stream: No such file or directory in ...Fatal error: require_once() [function.require]: Failed opening required '.:/usr/share/pear/HTML/BBCodeParser.php' (include_path='.:/usr/share/pear') in ... Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-159625 Share on other sites More sharing options...
redbullmarky Posted January 13, 2007 Share Posted January 13, 2007 it'd be worth trying out [url=http://uk2.php.net/manual/en/function.set-include-path.php]set_include_path[/url] to include the /usr/share/pear/HTML path, as .:/usr/share/pear/HTML isnt a valid path in itself. the colon ( : ) is a seperator for all of the allowed paths. the dot before signifies the current directory. so in effect, if the include_path is set to .:/usr/share/pear, what it's basically saying is "when including a file, look in either the current directory or the usr/share/pear directory.add the /usr/share/pear/HTML like this:[code]<?phpset_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/pear/HTML');?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-159629 Share on other sites More sharing options...
Tandem Posted January 13, 2007 Author Share Posted January 13, 2007 I'm getting open_basedir restrictions whatever i do. Perhaps i have to set open_basedir to something in php.ini? Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-159634 Share on other sites More sharing options...
trq Posted January 13, 2007 Share Posted January 13, 2007 Use this...[code]<?php set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/pear/HTML');?>[/code]Then, by all rights you should only need....[code]<?php require_once 'BBCodeParser.php';?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-159694 Share on other sites More sharing options...
Tandem Posted January 13, 2007 Author Share Posted January 13, 2007 [quote author=thorpe link=topic=122025.msg503733#msg503733 date=1168655191]Use this...[code]<?php set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/pear/HTML');?>[/code]Then, by all rights you should only need....[code]<?php require_once 'BBCodeParser.php';?>[/code][/quote]Ok i've done that and now i'm getting the following:Warning: require_once(BBCodeParser.php) [function.require-once]: failed to open stream: No such file or directory in ... on line 9The file is definitely there and i'm sure i've got the case right too. I'm totally stumped. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/33824-html_bbcodeparser-pear/#findComment-159942 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.