PEAR Manual
Prev | Chapter 2. Installation | Next

# Command line installer

Prerequisites
The following description requires the latest version of the PEAR package manager to be installed.

The command line installer is the easiest way to install PEAR packages on your system: It connects to the PEAR package server via a simple HTTP connection, loads the package on your system and installs it to the desired location.

## Fully-automatic installation

Using the command line installer is pretty straightforward and easy to use. Simply run the following line on your shell:

    $ pear install <package>

<package> has to be replaced with the name of the package you want to install (e.g. HTTP_Upload). To get a list of the available packages, you can point your browser to the PEAR package browser or you can run:

    $ pear remote-list

This command returns a list of all packages that are available in PEAR at the moment.

## Semi-automatic installation

If you have downloaded a package release from http://pear.php.net/ as a gzipped tar archive, you can also install it locally. To do this, run the following line on your shell:

    $ pear install <file>.tgz

This command will automatically install the package and does not require an online connection. `<file>.tgz` has to be replaced with the name of the downloaded file.

## Commands and Variables

Here's a list of commands available to the pear command line tool. Many of these commands may require root access to the server.

Command | Description
--- | ---
build | Build the extension from source
bundle | Download and unpack a PECL extension
channel-add | Add a Channel (PEAR 1.4+)
channel-alias | Specify an alias to a channel name (PEAR 1.4+)
channel-delete | Remove a channel from the list (PEAR 1.4+)
channel-discover | Initialize a channel from its server name (PEAR 1.4+)
channel-info | Retrieve information on a channel (PEAR 1.4+)
channel-update | Update an existing channel (PEAR 1.4+)
clear-cache | Clear the XML-RPC cache
config-create | Create a default configuration file (PEAR 1.4+)
config-get | Echo a specific configuration setting
config-help | Show information about a setting
config-set | Set a specific configuration setting value
config-show | Show all configuration setting values
convert | Convert a package.xml 1.0 format to package.xml 2.0 format (PEAR 1.4+)
cvsdiff | Execute and display a "`cvs diff -u`" on all files within the package
cvstag | Set a CVS release tag
download | Download a package but not install it
download-all | Downloads every available package
info | Display information about a package
install | Install a package, will report with success or failure
list | List installed packages
list-all | List all packages, packaged and/or available
list-channels | List available channels (PEAR 1.4+)
list-files | List files in an installed package (PEAR 1.4+)
list-upgrades | List available upgrades for the installed packages
login | Connects and authenticates to the remote PEAR server
logout | Logs out from the remote PEAR server
makerpm | Builds a RPM spec file from a PEAR package
package | Build a package
package-dependencies | Show package dependencies
package-validate | Validate package consistency
remote-info | Information about remote packages
remote-list | List remote packages
run-scripts | Run post-install scripts bundled with a package (PEAR 1.4+)
run-tests | Run regression tests
search | Search the remote package database
shell-test | Do a shell script test
sign | Sign a package distribution file
uninstall | Uninstall and remove a package
update-channels | Update the channel list (PEAR 1.4+)
upgrade | Upgrade a package to the current version (see also: preferred_state)
upgrade-all | Upgrade all packages (see also: list-upgrades)

And here's a list of available PEAR configuration variables. Use the `config-get`, `config-help`, `config-set`, and `config-show` command options to use these configuration variables. While installing PEAR on the system, PEAR will attempt to replace the default values with values specific to the given server. Adjust accordingly.

Variable Name | Description | Default Value
--- | --- | ---
bin_dir | Directory where executables are installed | `/usr/bin`
doc_dir | Directory where documentation is installed | `/usr/lib/php/docs`
ext_dir | Directory where loadable extensions are installed | `./`
php_dir | Directory where PHP files are installed (like PEAR files) | `/usr/lib/php`
cache_dir | PEAR installer cache directory, and used by XMLRPC | `/tmp/pear/cache`
data_dir | Directory where data files are installed | `/usr/lib/php/data`
php_bin | The PHP CLI or CGI binary for executing scripts | `/usr/bin/php`
test_dir | Directory where regression tests are installed | `/usr/lib/php/tests`
cache_ttk | Number of seconds that the local cache is used, and not updated (Time To Kill) | 3600
preferred_state | Preferred package state: stable, beta, alpha, devel, or snapshot | stable
umask | umask used when creating files (Unix-like systems only) | 22
verbose | Debug log level: 0-3 where 3 is full debug mode. | 1
http_proxy | The optional HTTP proxy address (host:port) used when downloading packages |
remote_config | Remote configuration file, used to mirror a local installation on a remote server through ftp. (PEAR 1.4+) |
auto_discover | Auto-discover new channels from command line or dependencies | 0
default_channel | Default channel (PEAR 1.4+) | pear.php.net (pecl.php.net if using the pecl command)
preferred_mirror | Preferred channel mirror (PEAR 1.4+) | pear.php.net (pecl.php.net if using the pecl command)
master_server | PEAR server [deprecated in PEAR 1.4+] | pear.php.net
password | PEAR password (used by maintainers) |
sig_bin | Signature handling program | `/sw/bin/gpg`
sig_keydir | Signature key directory | `/etc/pearkeys`
sig_keyid | The key used for signing |
sig_type | Package signature type (only gpg) | gpg
username | PEAR username (used by maintainers) |

Prev | Home | Next
Getting the manager | Up | Installation of a local PEAR copy on a shared host