How to install PHP 7

- PHP 7

installing PHP 7

Below, we explain how to install PHP 7. If you think it is a complex procedure, we have to disappoint you – installing PHP 7.0.0 is a piece of cake. Our guide is divided into several sections each of which describes PHP 7 installation depending on a specific platform. Additionally, you will find links to other Firebear’s materials about the latest version of the coding language in the end of the article.

Beware of PHP 5.X!!!

Chances are, you already have PHP 5.x running on your machine. The previous version of the language causes conflicts and leads to errors, so you must completely remove it from the system before going any further. Only then, it is possible to install PHP 7.0.0.

PHP 7 how to

For instance, if you are a loyal Ubuntu enthusiast, uninstalling PHP 5 is a breeze. Simply run the following command

How to install PHP 7

The following material describes how to install PHP 7 on Ubuntu, Debian, CentOS, RHEL, Mac OS X, and Windows. Appropriate versions of the software are listed below. In addition, there are links to PHP 7 packages for each platform.

Ubuntu

install php 7 on Ubuntu

You can easily install PHP 7 on the following Ubuntu versions:

  • 14.04
  • 15.04
  • 15.10

To install the software, use this package: PPA for PHP 7.0.

Now, when you know what package is necessary, it’s time to provide you with the appropriate command. To install PHP 7 on Ubuntu, run the following code:

Debian

install php 7 on Debian

You can install PHP 7 on the following Debian versions:

  • 6
  • 7
  • 8

To install the software, use this package: Dotdeb.

Now, when you know about the necessary PHP 7 package, add the following lines to the /etc/apt/sources.list file:

Where <distribution> should be replaced with wheezy, squeeze, or jessie:

The next step requires adding the GPG key:

Now, you can install PHP 7 on Debian via the following commands:

CentOS / RHEL

install php 7 on CentOS RHEL

PHP 7 can be installed on CentOS and RHEL as well. The appropriate repository can be downloaded here: Webstatic Yum.

By running the following code, you will install PHP 7 on CentOS/RHEL 7.x:

CentOS/RHEL 6.x PHP 7 installation is available via:

Mac OS X

install php 7 on Mac OS X

PHP 7 can be installed on Mac OS X from 10.6 to 10.11 with the aid of homebrew. Just run the commands below:

Alternatively, you can rely on php-osx tool:

Windows

install php 7 on Windows

Windows users should look for the appropriate PHP 7 distributions here: PHP 7 For Windows. Installing PHP 7 on Windows is another user-friendly procedure.

Other PHP 7 materials: