Ubuntu 12.04 Installation Apache2+php5+mysql

Source: Internet
Author: User
Tags curl phpinfo phpmyadmin





Lamp is the abbreviation for the Linux Web server combo set, which is apache+mysql+php. This tutorial teaches you how to install Apache2 server on Ubuntu 12.04 LTS server, including PHP5 (mod_php) +mysql.

The relevant IP settings used in this tutorial are modified in your environment.

1 We use the root account to install, first switch to the root account, enter the command:

sudo su

2 Installing MySQL 5
Enter the command:

apt-get install mysql-server mysql-client

To set the root account password during installation, the system will be prompted as follows:

New password for the MySQL "root" user:repeat password for themysql "root" User:


3 Installing Apache2
Enter the command:
apt-get install apache2

In the browser enter your server address listed http://192.168.0.100 to see if Apache2 is working, if displayed (itworks!), the description is already working.

Apache in Ubuntu default document root directory is/var/www, Profile/etc/apache2/apache2.conf, additional Configuration Storage subdirectory/etc/apache2 such as/etc/apache2/mods-enabled ( For the Apache module),/etc/apache2/sites-enabled (virtual host for virtualization hosts), and/ETC/APACHE2/CONF.D.

4 Installing PHP5
Install the PHP5 and Apache PHP5 modules:
apt-get install php5 libapache2-mod-php5

Then restart Apache:
/etc/init.d/apache2 restart

5 test PHP5/Can create a probe page
vi /var/www/info.php
Enter the following content:
<?php
Phpinfo ();
?>


Then open browser access (http://192.168.0.100/info.php):

You can see some of the modules that have been supported.

6 getting MySQL support for PHP5
We need to install Php5-mysql, first look at the PHP5 module
apt-cache search php5

Then install the required modules, such as the following command:

apt-get install php5-mysql php5-curl php5-gd php5-intlphp-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mingphp5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidyphp5-xmlrpc php5-xsl

Restart Apache2:


/etc/init.d/apache2 restart

Then brush the times you http://192.168.0.100/info.php see if the module support has been added.

7 PhpMyAdmin
Install phpMyAdmin to manage MySQL:

apt-get install phpmyadmin


phpMyAdmin Access Address: http://192.168.0.100/phpmyadmin/


Reference article: Http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-ubuntu-12.04-lts-lamp


Curl is a file transfer tool that uses URL syntax to work in command-line mode, and supports many protocols such as HTTP, FTP, Telnet, and so on. Often used in instances of language development such as PHP. So how do I install it on the lamp server?


In Ubuntu, for example, you need only one command:


sudo apt-get install curl libcurl3 Libcurl3-dev Php5-curl

Then restart your server:

Sudo/etc/init.d/apache2 restart

Now that curl is installed, you can see if the installation was successful by including: <?php Phpinfo (),?> content php file.



Ubuntu 12.04 Installation Apache2+php5+mysql

Related Article

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.