How To Install PHP7 On The Main OS's


 
 

Installing PHP 7.0.0 is easier than ever.  Here are instructions for installing the latest version on different platforms:

First step: Uninstall PHP 5.x

If you already have PHP 5.x installed you may encounter conflicts. Make sure to completely remove PHP 5.x from your system before installing php 7.

Ubuntu 14.04, 15.04, and 15.10:

On Ubuntu, uninstall PHP 5 running:

sudo apt-get purge php5-*

PHP 7.0.0 can be installed using Ondřej Surý's PPA:

sudo add-apt-repository ppa:ondrej/php-7.0
sudo apt-get update
sudo apt-get install php7.0

View full list of available packages

View the newest article PHP:How To Upgrade to PHP 7 on Ubuntu 14.04

Debian 6, 7, and 8

PHP 7 can be installed using the Dotdeb repository.

Add these two lines to your /etc/apt/sources.list file, replacing with either squeeze, wheezy, or jessie:

deb http://packages.dotdeb.org <distribution> all
deb-src http://packages.dotdeb.org <distribution> all

Add the GPG key:

wget https://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg

Install PHP 7:

sudo apt-get update
sudo apt-get install php7.0

View full list of available packages

CentOS / RHEL

PHP 7 can be installed using the Webstatic Yum repository.

If you're using CentOS/RHEL 7.x, run these three commands to add the repository and install PHP 7:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w

If you're using CentOS/RHEL 6.x, run these two commands to add the repository and install PHP 7:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install php70w

View full list of available packages

Mac OS X 10.6 - 10.11

PHP 7 can be installed using homebrew:

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php70

Or you can install it via Liip's php-osx tool:

curl -s http://php-osx.liip.ch/install.sh | bash -s 7.0

Windows

PHP 7 distributions for Windows can be found on the windows.php.net website: http://windows.php.net/download#php-7.0

 
 

tags: php7


We use our own cookies and third-party cookies to improve our services, show products based on your preferences, analyse the browsing habits of our users, and enable interaction with social networks. Continuing to browse our sites implies full acceptance of their use. You can change your cookie setting or get more information here: Cookies policy .