How to install lamp php7 on ubuntu

藏色散人
Release: 2023-03-09 20:26:01
Original
1844 people have browsed it

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 “<?php phpinfo();?>” > /var/www/html/index.php 
 sudo service apache2 restart
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template