Home  >  Article  >  Backend Development  >  Ubuntu branch Linux operating system installation LAMP environment

Ubuntu branch Linux operating system installation LAMP environment

WBOY
WBOYOriginal
2016-08-08 09:22:22950browse

Step1. Install Apache

Enter the command in the terminal

<span>sudo</span> apt-get <span>install</span> apache2

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

Step2. Install php5

  Enter in the terminal:

<span>sudo</span> apt-get <span>install</span> php5 libapache2-mod-php5 php5-mysql

  Restart apache2:

<span>sudo</span> /etc/init.d/apache2 restart

Note: If you want to shut down the apache service, you can do 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

  MySQL's restart, shutdown, and startup commands are also Similar to the corresponding commands of Apache2

Test whether the PHP5 is successfully installed:

<span>sudo</span> gedit /var/www/testphp.php

In the file that is opened, enter the following php code:

<?php <span>phpinfo</span>(); ?>

to save and close the files , 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. Step 3. Install mysql. Enter the following command in the terminal. And execute:

<span>sudo</span> apt-get <span>install</span> 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

<span>sudo</span> apt-get <span>install</span> libapache2-mod-auth-mysql php5-mysql phpmyadmin
  Adjust the permissions of the /var/www directory to facilitate editing of website files in the future.

<span>sudo</span><span>chmod</span><span>777</span> /var/www

The above introduces the LAMP environment for installing the Ubuntu branch Linux operating system, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

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