PET Posted March 6, 2007 Share Posted March 6, 2007 Well I use XAMPP witch also installs PEAR. Now I want to use PEAR in a script that I'v placed into htdocs (as usual). How do I call a PEAR script? <?PHP /** * XML_Beautifier example 1 * * This example displays the basic usage. * * @author Stephan Schmidt <schst@php.net> */ error_reporting( E_ALL ); require_once 'XML/Beautifier.php'; $fmt = new XML_Beautifier(); $result = $fmt->formatFile('test.xml', 'test2.xml'); if (PEAR::isError($result)) { echo $result->getMessage(); exit(); } echo "<h3>Original file</h3>"; echo "<pre>"; echo htmlspecialchars(implode("",file('test.xml'))); echo "</pre>"; echo "<br><br>"; echo "<h3>Beautified file</h3>"; echo "<pre>"; echo htmlspecialchars(implode("",file('test2.xml'))); echo "</pre>"; ?> This is a small example I try to run wich ask's for 'XML/Beautifier.php', ofcourse I get this: Warning: require_once(XML/Beautifier.php) [function.require-once]: failed to open stream: No such file or directory in C:\XAMPP\xampp\htdocs\example1.php on line 11 Fatal error: require_once() [function.require]: Failed opening required 'XML/Beautifier.php' (include_path='.;C:\XAMPP\xampp\Smarty\libs\') in C:\XAMPP\xampp\htdocs\example1.php on line 11 I guess I shoudn't copy the classes from PEAR into my htdocs directory... right? How to do it? 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.