How to install php pear on Ubuntu 15.04

When using PHP, the PEAR Package Manager is already installed unless one has used the ./configure option --without-pear.

If one uses a version of PHP that is supplied by Unix/Linux/BSD distributors it may be necessary to manually install PEAR. Users should consult the documentation for the respective distribution in this case.

If you want to re-install the Package Manager, you can use the following provisional way:

      
$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar
      

Please note, you may need to install the wget package via your Unix/Linux/BSD package manager. On Debian and Ubuntu this is done via:

      
      $ sudo apt-get install wget
      

Alternatively, download the go-pear.phar file via your browser.

If the process just exits without any output, your syslog will probably contain the following lines:

suhosin[4705]: ALERT - Include filename ('phar://go-pear.phar/index.php')
 is an URL that is not allowed
 (attacker 'REMOTE_ADDR not set', file '/root/go-pear.phar', line 1236)

To work around this problem, enable the phar in /etc/php5/conf.d/suhosin.ini:

suhosin.executor.include.whitelist = phar

Now check that PEAR works.

previous article

Leave a Reply