drkstr Posted July 30, 2008 Share Posted July 30, 2008 Hello, I'm getting an error when I run a pear package and I'm not sure where to start looking. It seems like it might be some kind of configuration problem but I'm not sure. When I run the php file that includes the pear package, I get the following error: [Tue Jul 29 19:45:20 2008] [error] [client 71.227.145.81] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'PEAR.php' (include_path='.:') in /usr/share/pear/XML/Serializer.php on line 30 I opened the source file to the pear package and all it has on line 30 is "require_once(PEAR.php)". Any ideas what's wrong? Thanks! ~Aaron Link to comment https://forums.phpfreaks.com/topic/117279-running-a-pear-package/ Share on other sites More sharing options...
damianjames Posted July 30, 2008 Share Posted July 30, 2008 Your PHP script is looking for "PEAR.php" and it can't find it. require_once(PEAR.php) This means it's looking for PEAR.php in the same directory as the PHP file that refers to it. Link to comment https://forums.phpfreaks.com/topic/117279-running-a-pear-package/#findComment-603294 Share on other sites More sharing options...
drkstr Posted July 30, 2008 Author Share Posted July 30, 2008 I figured that much, but why would a PEAR package not be able to find PEAR.php? I shouldn't have to modify the source to a PEAR package so it makes me think there is something else wrong. I just don't know what. Any ideas? Thanks! ~Aaron **Edit** Just so I'm clear, the error is coming from the pear package, not my script. Here is my script in it's entireity: <?php // include class file require_once("XML/Serializer.php"); // create object $serializer = new XML_Serializer(); // create array to be serialized $xml = array ( "book" => array ( "title" => "Oliver Twist", "author" => "Charles Dickens")); // perform serialization $result = $serializer->serialize($xml); // check result code and display XML if success if($result === true) { echo $serializer->getSerializedData(); } ?> XML/Serializer.php is the PEAR package. Link to comment https://forums.phpfreaks.com/topic/117279-running-a-pear-package/#findComment-603301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.