大致流程:
apache安装:
edemon@linux:~$ sudo apt install apache2
php安装:
edemon@linux:~$ sudo apt install php7.0-cli
……
Creating config file /etc/php/7.0/cli/php.ini with new version
mysql安装:
edemon@linux:~$ sudo apt install mysql-server
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Checking if update is needed.
This installation of MySQL is already upgraded to 5.7.12, use –force if you still need to run mysql_upgrade
Setting up mysql-server (5.7.12-0ubuntu1) …
其他模块:
edemon@linux:~$ sudo apt-get install libapache2-mod-php7.0
检测php:
edemon@linux:~$ cat /etc/apache2/mods-enabled/php7.0.load
# Conflicts: php5
LoadModule php7_module /usr/lib/apache2/modules/libphp7.0.so
测试并开启服务:
edemon@linux:~ sudoservicemysqlrestarted