Ubuntu under the lamp environment to build Apache, MySQL, PHP

Source: Internet
Author: User
Tags php and mysql
As a result of just learning Linux, choose the interface of the more friendly Ubuntu for research. Command line + visualization for beginners, the combination is relatively good, the graphical interface as a command line of a transition can be more intuitive to see the effect. In the application of learning is a better way, I was to build a Linux-based server environment for learning, according to the information collected on the Internet, to complete the lamp configuration.

The main process is as follows:

1.LAMP installation order problem, now is installed by default Linux system, my version is Ubuntu 12.04. Generally the recommended order is MySQL Apache last install PHP, in my practice down Apache and MySQL order can be reversed, Because the two dependencies are not very strong, PHP has to be installed behind both, because it relies on Apache and MySQL services.

2.MysSQL Installation: Open command line input: sudo apt-get install mysql-server enter admin password Select y

In the middle of the installation will be prompted to enter the MySQL administrator password, set the MySQL password:

View Services after installation: input sudo netstat-tap | grep MySQL Displays the port that is listening for the installation to succeed

3. Install Apache on the command line input sudo apt-get install apache2 Enter the administrator password and select Y

Check whether the installation is successful: Open the browser input 127.0.0.1 the interface that appears to indicate the successful installation

4. Install PHP input sudo apt-get install php5 libapache2-mod-php5

Whether the test succeeds after the installation is complete:

First, you need to change the WWW directory to take ownership so that you can create new document input sudo chmod 777/var/www

Create a new document: sudo vi/var/www/info.php

Press the I key to edit the file input

Phpinfo ();

?>

ESC after input: Wq save exit

Reboot under Apache: Enter sudo/etc/init.d/apache2 restart.

Enter 127.0.0.1/phpinfo.php in the browser, the relevant configuration information of PHP indicates success

5. Finally install the associated PHP and MySQL extension pack:

sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5 -ming php5-ps Php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl;

6. For more convenient management of the database It is also recommended to install phpMyAdmin. command line input sudo apt-get install phpMyAdmin, in the middle will appear a prompt to enter the management password, follow the prompts to enter.

After the installation is complete, you need to copy the phpMyAdmin folder to the WWW file for management: sudo cp/usr/share/phpmyadmin/var/www-a

Then open the browser input http://127.0.0.1/phpmyadmin appears after the following page indicates that it has been successful

At this point the basic environment has been completed, if there are steps out of the proposed search, I installed the overall is relatively smooth.

Finally, it can be seen that the installation environment in Linux is really more convenient than windows under the compatibility of environment variables such as the need to configure the mess, and really greatly improve the efficiency.

You may also like the following about lamp-related content:

Lamp platform installs XCache and memcached to accelerate website operation Http://www.linuxidc.com/Linux/2015-06/118835.htm

Build lamp platform Environment under CentOS 7 http://www.linuxidc.com/Linux/2015-06/118818.htm

CentOS 6.5 System installation Configuration lamp (APACHE+PHP5+MYSQL) Server environment http://www.linuxidc.com/Linux/2014-12/111030.htm

Ubuntu 14.04 configuration Lamp+phpmyadmin PHP (5.5.9) Development environment http://www.linuxidc.com/Linux/2014-10/107924.htm

Ubuntu 14.10 Installation LAMP service graphic detailed http://www.linuxidc.com/Linux/2014-12/110082.htm

Lamp combined with NFS to build a small blog site http://www.linuxidc.com/Linux/2015-08/121029.htm

For more information about Ubuntu see the Ubuntu feature page http://www.linuxidc.com/topicnews.aspx?tid=2

This article permanently updates the link address : http://www.linuxidc.com/Linux/2016-01/127180.htm

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