Home>Article>Backend Development> How to install lamp php7 on ubuntu

How to install lamp php7 on ubuntu

藏色散人
藏色散人 Original
2021-05-21 09:49:44 1777browse

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.

How to install lamp php7 on ubuntu

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
How to install lamp php7 on ubuntu
Then install apache2
sudo apt-get install apache2
How to install lamp php7 on ubuntu
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 “” > /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.
How to install lamp php7 on ubuntu
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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn