Search code examples
phppearmacports

What's an appropriate include_path PHP/PEAR setting for Macports?


I'm using Macports for my PHP development. I thought that everything associated with Macports should be located under/opt/local, but I can't load the PEAR::Mail_Mime package I just installed through PEAR. I did confirm that the path to pear is /opt/local/bin/pear, but I have no idea where it dumped the package files, so I don't know how to include them in my path. Any pointers?


Solution

  • Pear files are typically installed in a share/php directory although I'm not on my mac right now so I can't check exactly where that might be. You can find that directory using locate though. From your terminal type:

    $ locate PEAR.php
    

    It should return something like /usr/share/php/PEAR.php - In this example /usr/share/php should be in my include path. Mail.php and Mail/mime.php should also be in this directory.