How to install lamp php7 on ubuntu: first install mysql through the "sudo apt-get install" command; then install apache2; finally install php7 and apache2 php7 module.
The operating environment of this article: ubuntu 16.04 system, PHP7.0 version, DELL G3 computer
Ubuntu 16.04 LAMP (PHP7.0) environment construction and test
First install mysql
sudo apt-get install mysql-server mysql-client
Then install apache2
sudo apt-get install apache2
Install php7
sudo apt-get install php7
Note: The php web page cannot be parsed at this time because there is no Install apache php module
Install apache2 php7 module
sudo apt-get install libapache2-mod-php7.0
Test whether php is working properly
sudo mv /var/www/html/index.html /var/www/html/index.html.bak sudo echo “<?php phpinfo();?>” > /var/www/html/index.php sudo service apache2 restart
Open the browser and enter localhost or 127.0.0.1. You will see the following picture, which means that LAMP is configured.
Note: There is no test here to see if Mysql is normal, please experiment by yourself.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to install lamp php7 on ubuntu. For more information, please follow other related articles on the PHP Chinese website!