Recipe 26.4. Installing PEAR Packages26.4.1. ProblemYou want to install a PEAR package. 26.4.2. SolutionDownload and install the package from the appropriate PEAR Channel server using the PEAR installer: % pear install Package_Name You can also install from another PEAR Channel: % pear install channel/Package_Name You can also install from any location on the Internet: % pear install http://pear.example.com/Package_Name-1.0.0.tgz Here's how to install if you have a local copy of a package: % pear install Package_Name-1.0.0.tgz 26.4.3. DiscussionTo install PEAR packages, you need write permission where the packages are stored; this defaults to /usr/local/lib/php/. You can also request multiple packages at the same time: % pear install XML_Parser XML_Tree When installing a package, PEAR checks that you have all the necessary PHP functions and PEAR packages that the new package depends on. If this check fails, PEAR reports on the dependencies: % pear install MDB2_Driver_Mysql As you can see from the error message, the PEAR installer made no attempt to download dependencies. This default behavior puts you in control by not assuming that you want to install or upgrade the related dependencies. The most convenient install command switch is -o, which is the shortcut for --onlyreqdeps, which installs all required dependencies. Using the -o switch, the installation is now successful: % pear install -o MDB2_Driver_Mysql If you want to ignore the required dependencies, you can use the -n or --nodeps switches to tell the installer to ignore dependencies and install anyway. 26.4.4. See Also26.7 for information on installing PECL packages; Recipe 26.5 for more on upgrading an existing package; Recipe 26.6 to uninstall a package. |
Thursday, February 4, 2010
Recipe 26.4. Installing PEAR Packages
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment