Home  >  Article  >  Backend Development  >  Installing LAMP environment in Linux operating system, Linux operating system lamp_PHP tutorial

Installing LAMP environment in Linux operating system, Linux operating system lamp_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:48:29786browse

Linux operating system installs LAMP environment, linux operating system lamp

Step1. Install Apache

Enter the command in the terminal

Copy code The code is as follows: sudo apt-get install apache2

Open the browser and enter: 127.0.0.1 in the address bar. If “It works!” appears, it means the installation is successful

Step2. Install php5

Enter in terminal:

Copy the code The code is as follows: sudo apt-get install php5 libapache2-mod-php5 php5-mysql

Restart apache2:

Copy code The code is as follows: sudo /etc/init.d/apache2 restart

Note: If you want to shut down the apache service, you can execute the following command:

sudo /etc/init.d/apache2 stop

If you want to open the apache service, you can execute the following command:

sudo /etc/init.d/apache2 start

The restart, shutdown, and startup commands of mysql are also similar to the corresponding commands of apache2

Test whether php5 is installed successfully:

Copy the code The code is as follows: sudo gedit /var/www/testphp.php

In the opened file, enter the following php code:

Copy code The code is as follows:

Save and close the file, enter the following IP address in the browser address bar: 127.0.0.1/testphp.php. If information about php appears, it means that php is installed successfully

Step3. Install mysql

Enter the following command in the terminal and execute it:

Copy code The code is as follows: sudo apt-get install mysql-server mysql-client

During the installation process, the interface for setting a password for the root user in mysql will appear. Just follow the prompts

 

Step4. Install phpmyadmin

Enter the following command in the terminal and execute

Copy code The code is as follows: sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

Adjust the permissions of the /var/www directory to facilitate editing of website files in the future.

Copy the code The code is as follows: sudo chmod 777 /var/www

The above is the entire content of this article. I hope you all like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1022780.htmlTechArticleLinux operating system installs LAMP environment, linux operating system lamp Step 1. Install Apache and enter the command in the terminal to copy the code. The code is as follows :sudo apt-get install apache2 Open the browser and go to...
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