ubuntu16.04 64位server安装php7

You can do the following:

sudo apt-get install python-software-properties
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update

Optionally purge PHP 5:

sudo apt-get remove php5-common -y

Or directly purge it including configuration files:

sudo apt-get purge php5-common -y

And finally install PHP 7:

sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y

Optionally clean up unneeded packages afterwards:

sudo apt-get --purge autoremove -y

Alternatively, you can install PHP 7.0 from sources using this script script or following instruction on this blog.

原文地址:https://www.cnblogs.com/yuanxiaoping_21cn_com/p/5527238.html