bb-code-php-application
Som ledde mig till den här guiden för att installera pear.
getting-started-with-pear
Jag körde php go-pear.php som root
det enda jag ändrade på var alternativ 1 som jag satte till /usr/local/bin/
vill inte kladda ner min hemkatalog med grejer som jag inte får plocka bort.
Sen skapade jag test.php under var/www/PHPtest/BBCodeTest/test.php
Kod: Markera allt
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?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>';
}
?>
<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>
</body>
</html>
och fick följande felmeddelande
Kod: Markera allt
( ! ) Warning: require_once(HTML/BBCodeParser.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/PHPtest/BBCodeTest/test.php on line 14
Call Stack
# Time Memory Function Location
1 0.0024 58692 {main}( ) ../test.php:0
( ! ) Fatal error: require_once() [function.require]: Failed opening required 'HTML/BBCodeParser.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/PHPtest/BBCodeTest/test.php on line 14
Call Stack
# Time Memory Function Location
1 0.0024 58692 {main}( ) ../test.php:0
Kod: Markera allt
equire_once 'HTML/BBCodeParser.php';
Hur löser jag det här problemet?