1. The Apache installation

Installing the Apache Server

sudo apt-get install apache2
Copy the code
  1. Check whether the Apache is installed successfully

Open the browser and enter localhost. If the following interface is displayed, the installation is successful

  1. PHP7.0 installation

Sudo apt - get the install php7.0Copy the code
  1. Check whether PHP is installed successfully

php -V
Copy the code

If the output contains the version number, it indicates success

  1. Install the Apache plug-in to recognize PHP files

Sudo apt - get the install libapache2 - mod - php7.0Copy the code
  1. Checks whether the PHP file can be parsed and accessed

The first step is to index to the Apache project directory

cd /var/www/html
Copy the code

Step 2: Create a NEW PHP file

sudo vim test.php
Copy the code

Write the following

<? php phpinfo(); ? >Copy the code

Third, the browser to: localhost/test.php, if you get some information about PHP, indicating that the PHP file can be parsed

  1. Mysql installation

sudo apt-get install mysql-server mysql-client
Copy the code
  1. Check whether mysql is installed successfully

mysql -V
Copy the code

If the version information is displayed, the installation is successful

  1. Install the MYSQL plugin for PHP

Sudo apt - get the install php7.0 - mysqlCopy the code
  1. Install any extension libraries and toolkits you may need

Sudo apt-get install php7.0-gd php7.0-mbstring php7.0-xml sudo apt-get install composerCopy the code

Composer is a toolkit for resolving PHP dependencies. Check whether Composer is installed successfully

composer
Copy the code

At this point, lamp software is completely installed