Setting up the environment on Ubuntu

Setting up your environment on Ubuntu is the easiest of the three platforms. In fact, you could take the provisioner.sh script from the Setting up the environment with Vagrant section and execute it on your laptop. That should do the trick. However, just in case you already have some of the tools installed or you want to have a sense of control on what is going on, we will detail each step.

Installing PHP

The only thing to consider in this section is to remove any previous PHP versions on your system. To do so, you can run the following command:

$ sudo apt-get -y purge php.*

The next step is to add the necessary repositories in order to fetch the correct PHP version. The commands to add and update them are:

Get Learning PHP 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.