Ubuntu安装PHP7
Ubuntu 16.04官方源自带PHP7,所以可以直接使用apt-get来安装。
(1)安装PHP7以及常用扩展。sudo apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-mbstring php7.0-gd php7.0-json php7.0-cli php7.0-curl libapache2-mod-php7.0
(2)启用Apache的php7.0模块,然后重启Apache。sudo a2enmod php7.0
sudo systemctl restart apache2
(3)启动php7.0-fpm进程。sudo systemctl start php7.0-fpm
(4)查看php7.0-fpm运行状态。systemctl status php7.0-fpm
(5)测试PHP是否安装成功php -v
或
php --version