*not* just another blog ;)

Installing PHP 7.1 on Ubuntu 16.04

- Posted in Quick Tip by with comments

I am trying to install Laravel on my web server running VestaCP on Ubuntu 16.04 through softaculous and it's telling me that it requires PHP 7.1 to be installed and I only have PHP 7.0. Trying to install it via apt-get quickly shows that it's not available in Ubuntu 16.04's repository.

Here's how I got it up and running:

First, we need to make sure we have what we need installed:

sudo apt-get install software-properties-common

Now we can use the tool to add a repository, in this case, the one for PHP:

sudo add-apt-repository ppa:ondrej/php

Of course, we need to update apt so it knows about the new packages:

sudo apt-get --allow-unauthenticated update

In my case, it's telling me that the package or PPA can't be signed, so I've used the allow-unathenticated flag.

Now we can install PHP 7.1 from the repository:

sudo apt-get install php7.1

It's warning me that I'm about to install something that isn't signed, I'm going to proceed anyway.

Now I will install a few extra things for PHP7.1 that I've found that nextCloud in particular needs, but installing these now will also mean I don't need to do it again in future :)

sudo apt install php7.1-gd php7.1-json php7.1-mysql php7.1-curl php7.1-mbstring php7.1-intl php7.1-mcrypt php-imagick php7.1-xml php7.1-zip php7.1 libapache2-mod-php7.1 php7.1-mysql php7.1-curl php7.1-gd php7.1-intl php-pear php-imagick php7.1-imap php7.1-mcrypt php-memcache  php7.1-pspell php7.1-recode php7.1-sqlite3 php7.1-tidy php7.1-xmlrpc php7.1-xsl php7.1-mbstring php-gettext

Great, it's installed.. let's see if it's working..


Now I can continue on my way :)

I am installing Laravel because I'd like to learn PHP and a framework at the same time, and from what I can tell, Laravel is the most recommended for newbies, so when I start on that I will start blogging about it.