Linux operating system installation lamp Environment _php instance

Source: Internet
Author: User

Step1. Install Apache

Enter a command in terminal

Copy Code code as follows:
sudo apt-get install apache2

Open the browser, enter in the Address bar: 127.0.0.1, if there is "It works!", indicating the successful installation

Step2. Install PHP5

Enter in Terminal:

Copy Code code as follows:
sudo apt-get install php5 libapache2-mod-php5 php5-mysql

Reboot apache2:

Copy Code code as follows:
Sudo/etc/init.d/apache2 restart

Note: If you want to turn off the Apache service, you can execute the following command:

Sudo/etc/init.d/apache2 stop

If you want to turn on the Apache service, you can execute the following command:

Sudo/etc/init.d/apache2 start

MySQL reboot, shutdown, start command is similar to the APACHE2 command

Test whether the PHP5 is installed successfully:

Copy Code code as follows:
sudo gedit/var/www/testphp.php

In the file that opens the file, enter the following PHP code:

Copy Code code as follows:
<?php phpinfo ();?>

Save and close the file, enter the following IP address in the browser address bar: 127.0.0.1/testphp.php, if there is information about PHP, the PHP installation is successful

Step3. installing MySQL

Enter the following command in terminal and execute:

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

In the course of installation, the user will be given a password to the root of MySQL interface, follow the prompts to do the line

  

Step4. Install phpMyAdmin

Enter the following command in terminal and execute

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

Adjust the permissions of the/VAR/WWW directory to facilitate future editing of Web site files.

Copy Code code as follows:
sudo chmod 777/var/www

The above mentioned is the entire content of this article, I hope you can enjoy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.