Steps to build a PHP environment under Linux (Ubuntu) _unix Linux

Source: Internet
Author: User
Tags install php phpmyadmin

I. Installation of APACHE2

sudo apt-get install apache2

Second, test Apache2

Enter the following address in the Address bar and appear as shown in the picture, which means the installation was successful

http://localhost/

Third, restart the Apache2 service

Sudo/etc/init.d/apache2 Restart//' restart '-> ' stop ' off service; ' Restart '-> ' start ' service

Four, install PHP

sudo apt-get install php5 libapache2-mod-php5
' 
0x03. Test php
' cmd
sudo vim/var/www/html/ info.php

Content is the following code, the successful appearance of the following picture indicates success

<?php
 Echo phpinfo ();

V. Installation of MySQL

Enter the following command to install, the installation process will let you fill in the MySQL username and password

sudo apt-get install mysql-server
sudo apt-get install mysql-client

Vi. installation of phpMyAdmin

During the installation process, select Apache2, and the next step is to configure the database and enter a password.

sudo apt-get install phpMyAdmin

Seven, Test phpMyAdmin

Execute the following command

sudo ln-s/usr/share/phpmyadmin/var/www

Then the address bar enters the following address, the landing interface indicates success, as shown in

Http://localhost/phpmyadmin

If the 404 interface appears, execute the following statement

sudo vim/etc/apache2/apache2.conf

Add the following line at the end

Include/etc/phpmyadmin/apache.conf

Eight, install other modules

sudo apt-get install libapache2-mod-php5
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install Php5-mysql
sudo apt-get install PHP5-GD

Ix. Modification of/var/www/html permissions

sudo chmod 777/var/www/html

Ten, summary

The above is the entire content of this article, I hope to everyone in the Linux (Ubuntu) to build a PHP environment can help, if there are questions you can leave a message to discuss.

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.