Saturday 2 December 2017

upgrade - How to install an updated version of PEAR / PHPUnit on Ubuntu?


Most tutorials online show how to install PEAR by doing this:


sudo apt-get install php-pear

This installs version 1.6.1. It works great because it's super easy! My problem is that I want to install PHPUnit and it requires PEAR version 1.8.1 so my install of PHPUnit failed. So how do I install a newer version of PEAR on Ubuntu?



Answer



First, install PEAR.


sudo apt-get install php-pear

Next, tell PEAR to update its own channel.


sudo pear channel-update pear.php.net

Then, tell PEAR to upgrade itself to the newest version.


sudo pear upgrade-all

You should now have the newest version of PEAR installed.


To install PHPUnit, let PEAR know where to find PHPUnit.


sudo pear channel-discover pear.phpunit.de

Then install PHPUnit. (the -a makes sure all dependency packages are also installed)


sudo pear install -a phpunit/PHPUnit

Update:


According to the latest PHPUnit installation documentation, you can install PHPUnit with the following commands (make sure you have updated PEAR first):


sudo pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...