Linux operating system installation lamp environment, Linux operating system lamp_php tutorial

Source: Internet
Author: User

Linux operating system installation lamp environment, Linux operating system lamp


Step1. Installing Apache

Enter a command in terminal

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

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

Step2. Installing PHP5

In the terminal, enter:

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

Restart Apache2:

Copy the 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 open the Apache service, you can execute the following command:

Sudo/etc/init.d/apache2 start

MySQL restart, shutdown, and start commands are also similar to the corresponding commands for apache2

To test whether the PHP5 was installed successfully:

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

In the file of the open file, enter the following PHP code:

Copy the 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 installation of PHP is successful

Step3. Install MySQL

Enter the following command in terminal and execute:

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

During the installation process, you will be presented with a password-setting interface for the root user in MySQL, just follow the prompts.

  

Step4. Installing phpMyAdmin

Enter the following command in the terminal and execute

Copy the 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 editing of Web site files later.

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

The above is the whole content of this article I hope you can enjoy.

http://www.bkjia.com/PHPjc/1022780.html www.bkjia.com true http://www.bkjia.com/PHPjc/1022780.html techarticle Linux operating system installed lamp environment, Linux operating system lamp Step1. Install Apache in terminal enter the command to copy the code as follows: sudo apt-get install apache2 Open Browser, in ...

  • 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.