1. Introduction: it's
    simple

Introduction: it's simple

Installing Pyrus is much simpler than installing PEAR. Installing PEAR requires downloading a separate installation and installing PEAR before you can use it to install any packages.

To install pyrus, you must follow two simple steps:

  1. Install PHP 5.3.1 or newer. Pyrus needs the phar, simplexml, libxml2, spl and pcre extensions in order to work. Fortunately, these are all enabled by default in PHP 5.3.
  2. download pyrus.phar from the pear2.php.net website front page

That's it, pyrus has no external dependencies. Using Pyrus is also simple, one simply passes it to the command-line interface (CLI) like so:

     
php pyrus.phar install packagename
     

The first time pyrus is run on your system, it will ask where you would like to install packages. After this, one can simply use it.

To match PEAR, it is also possible to create a convenience script for accessing pyrus. Here is a sample script for unix systems:

#!/bin/bash
/usr/local/bin/php -dphar.readonly=0 /home/username/pyrus.phar $*

If your system has open_basedir enabled, the script should instead look like:

#!/bin/bash
/usr/local/bin/php -dphar.readonly=0 -dopen_basedir= -dsafe_mode= /home/username/pyrus.phar $*

Windows users can create a batch file similar to the unix script named pyrus.bat:

@ECHO OFF
C:\php5\php -dphar.readonly=0 -dopen_basedir= -dsafe_mode= C:\php5\pyrus.phar %*

Place the shell script (on unix) or batch file (on windows) in your path, and then you can run commands like so:

     
pyrus install packagename
     
Installation (Pyrus) (Previous) Installation (PEAR) (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

Note by: user@example.com
Your PHP needs to be compiled with the sqllite3 extension or else pyrus will not work.
Note by: user@example.com
This doesn't really help if there is no recommended install directory? Where does pear usually keep it's packages?
Note by: user@example.com
Its not simple. PHP5.3 documentation on phar and other extensions is obtuse to say the least. This site may be ok for those in the know. I'll look elsewhere
Note by: user@example.com
On XP, and being a very recent install of PHP 5.3.3, I found Pyrus would not install complaining that it could not write to configuration files because of permissions.

solve it with
mkdir "%USERPROFILE%\My Documents\pear"

and creating a zero length file
"%USERPROFILE%\My Documents\pear.config"

The error was just misleading - I guess it expected pear to be installed first.
Note by: doconnor
Pyrus: http://pear2.php.net/
Note by: Neil
Why not link to pyrus.phar on this page? Just curious. Having trouble locating the link on the home page. Information overload...