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

Ubuntu branch Linux operating system installation LAMP environment

WBOY
Release: 2016-08-08 09:22:22
Original
1014 people have browsed it

Step1. Install Apache

Enter the command in the terminal

<span>sudo</span> apt-get <span>install</span> apache2
Copy after login

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
Copy after login

  Restart apache2:

<span>sudo</span> /etc/init.d/apache2 restart
Copy after login

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
Copy after login

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

<?php <span>phpinfo</span>(); ?>
Copy after login

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
Copy after login
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
Copy after login
  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
Copy after login

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.

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