Upgrade PHP version on Ubuntu
If like me you always struggle when it comes to upgrade your PHP version here is a small on how to do it on ubuntu and the possible bugs and how to fix it.
Upgrade your apt-get
sudo apt-get upgrade
Add Ondrej Sury's PHP PPA repoMore info here.
If this gives you an error you might want to try to run this first:
sudo apt-add-repository ppa:ondrej/php
If you still have an error and it ressembles to this:
sudo apt-get install software-properties-common python-software-properties
UnicodeDecodeError: 'ascii' codec can't decode byte 0x* in position *: ordinal not in range(128)"Try the following commands:
sudo locale-gen en_US.UTF-8
Update the package list and install the PHP version you want
For PHP 5.5:
sudo apt-get update
For PHP 5.6:
sudo apt-get install php5.5
And PHP 7:
sudo apt-get install php5.6
Et voila normally at this point if you run php-v you should see the new version ! If not don't hesitate to say it in the comments.
sudo apt-get install php7