install - install a package

Introduction

The install command is used to install packages and accepts a list of package names to install as arguments. Unlike upgrade, the install command will only install new packages.

Install recognizes several different ways of specifying a package:

Ways of specifying a package for installation
Package type Local/Remote Example
package.xml file Local php pyrus.phar install /path/to/package.xml
Package release archive Local php pyrus.phar install /path/to/PackageName-1.2.3.tgz
Static url Remote php pyrus.phar install http://example.com/PackageName-1.2.3.tgz
Abstract package Remote php pyrus.phar install PackageName

Abstract Packages are documented here.

--optionaldeps

By default, required package dependencies are also installed. To also automatically install optional dependencies (not dependency groups, but dependencies specified using the <optional> tag in package.xml), pass the -o or --optionaldeps option to the install command:

php pyrus.phar install -o PackageName

--plugin

Plugins (documented here) must be explicitly installed with the -p or --plugin option. Plugins are installed into the location specified by the plugins_dir configuration variable, which defaults to the same location that the user configuration file is located ($HOME/.pear in unix, <My Documents>\pear on windows).

php pyrus.phar install -p PEAR2_Pyrus_Developer

--packagingroot

Developers packaging RPMs or other forms of distribution for OS vendors should use the -r or --packagingroot option to install a package into a subdirectory for creating the RPM.

php pyrus.phar install -r /home/myuser/package PackageName

For the example above, if the default Pyrus installation is in /usr/local/lib/pear, all files will be installed into /home/myuser/package/usr/local/lib/pear. Another way of understanding this is that the packagingroot option instructs Pyrus to treat /home/myuser/package as if it were the root directory /.

Developers packaging RPMs or other forms of distribution for OS vendors should use the -r or --packagingroot option to install a package into a subdirectory for creating the RPM.

php pyrus.phar install -r /home/myuser/package PackageName

--force

The --force or -f option can be used to force installation if there are errors. For instance, this can be used to override problems in dependency validation, or to force installation of a package that is not stable enough. As such, it should be used sparingly if at all. Better is to request a specific version for installation.

Commands available in Pyrus (Previous) upgrade - upgrade or install a package (Next)
Last updated: Sat, 25 Oct 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

Note by: cconstantine
How to get packages from other channels:

It's not shown above, but you can specify a channel without having to specify the exact package version. So if, for example, you want a package from the "pear.php.net" channel, you can use the last form shown above with the channel added. You don't have to find the full package path, or specific version you want:

php phyrus.phar install pear.php.net/Some_Package