3

I just wanted to install this class from Pear:

http://pear.php.net/package/Mail_mimeDecode/

After this command:

sudo pear install Mail_mimeDecode-1.5.5 

I have this:

downloading Mail_mimeDecode-1.5.5.tgz ... Starting to download Mail_mimeDecode-1.5.5.tgz (11,554 bytes) .....done: 11,554 bytes downloading Mail_Mime-1.8.9.tgz ... Starting to download Mail_Mime-1.8.9.tgz (33,796 bytes) ...done: 33,796 bytes install ok: channel://pear.php.net/Mail_Mime-1.8.9 install ok: channel://pear.php.net/Mail_mimeDecode-1.5.5 

So everything looks fine. But when i want to use this class i got this error:

Class 'Mail_mimeDecode' not found 

I try use it like this ($xml is a string with an XML inside):

$mime = new \Mail_mimeDecode($xml); 

I also don't see it in my phpinfo Profiler. Am I missing something ? I work on Symfony2 Application if that changes anything...

8
  • Are you requiring it in your code? Commented Apr 15, 2015 at 14:17
  • I'm doing it like this: "new \Mail_mimeDecode($xml)". $xml is a string like it should be. Commented Apr 15, 2015 at 14:18
  • 1
    My point is, are you requiring/including it? Where in your code are you saying, "load this file that contains this class"? Commented Apr 15, 2015 at 14:19
  • Shouldn't it work like another classes, like Datetime ? I have no idea how I should use it properly than. I'm installing first time something from pear o.O Commented Apr 15, 2015 at 14:21
  • 1
    DateTime is a native PHP class: it's included in PHP itself. What you're doing is downloading a PHP class with PEAR. Your PHP environment has no idea that class exists, because you haven't told it that it does. You need to either include the class in some way like this: include_once('/path/to/Mail_mimeDecode.php');, or add it via an autoloader such as composer. Reference here Commented Apr 15, 2015 at 14:26

1 Answer 1

3

You have to configure you PHP include path correctly. Check the PEAR installation section in the manual.

Sign up to request clarification or add additional context in comments.

1 Comment

I used James Spence tips and It's working for me now but your answer It's quite useful too ;-)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.