Published on 2005-10-12 05:13:53

Greg Beaver have posted nice tips for re-distributing PEAR/PHP outside of php.net. The problem if installroot was not set correctly pear command will be breaked which will cause fatal error on require_once. Greg gives two possible solutions for distributing PEAR 1.4.x, one for PHP versions earlier than 5.1, and one for PHP 5.1 and newer. For earlier PHP versions, the best thing to do is to perform these steps:

  1. install PEAR using installroot option, just as you always have
  2. ALSO bundle up the install-pear.php file from pear-core at cvs.php.net
  3. Use a %post option and run the CLI version of php on install-pear.php like so:
  4. %post
    php install-pear.php -d %{_libdir}/php/pear -b %{_bindir}
  5. Use a %postun option to erase the contents of PEAR via:
  6. %postun
    pear uninstall -n --ignore-errors PEAR
    rm -rf %{_libdir}/php/pear

Read More


Related Entries

Member of the PHP Magazine Network, Copyright (C) 2005-2009 phpmagazine.net All Rights Reserved