Install PHP 7.1 on Ubuntu 16.04 Xenial Xerus LTS

You want to run the latest PHP version 7.1 on Ubuntu 16.04 Xenial Xerus LTS? No problem.

Unfortunately Ubuntu Xenial comes with PHP 7.0. To run PHP 7.1 you have to include the Personal Package Archive (PPA) by Ondřej Surý.

So, let’s get started:

That’s the line to add the PHP repository by Ondřej Surý.

After that, first update the package lists:

Okay. If you had installed PHP 7.0 before, you have to remove it first to avoid complications. If you haven’t, just skip this step:

Now the last step is to install PHP 7.1:

This will install PHP 7.1 with the Apache2 libapache-mod-php module.

You can test if the installation worked with the following command:

That’s it! Have much fun with PHP 7.1!

Leave a Reply

Your email address will not be published. Required fields are marked *