This article describes how to build the lamp environment in ubuntu12.04amd64.
Required software:
Apache: http://httpd.apache.org/
Php: http://www.php.net/
Mysql: http://www.mysql.com/
Ubuntu: http://www.ubuntu.com/
Phpmyadmin: the http://www.phpmyadmin.net/
Installation:
In ubuntu, you need to use the root identity for operations. Therefore, use the following command to ensure that you log on as the root identity:
Copy codeThe code is as follows:
Sudo su
Install mysql
Copy codeThe code is as follows:
Apt-get install mysql-server mysql-client
You will be asked to provide the password of a mysql root user. we need to set the password in the red area.
Install apache2
Copy codeThe code is as follows:
Apt-get install apache2
Note: The default apache document root directory is the/var/www directory on ubuntu, and the configuration file is/etc/apache2/apache2.conf. Configure the sub-directories stored in the/etc/apache2 directory.
Install php5
Copy codeThe code is as follows:
Apt-get install php5 libapache2-mod-php5
Restart after installation
Copy codeThe code is as follows:
/Etc/init. d/apache2 restart
Test whether the installation is successful.
Copy codeThe code is as follows:
Vi/var/www/info. php
Enter
Copy codeThe code is as follows:
<? Php
Phpinfo ()
?>
Then access
Php5 is supported by mysol
For php to be supported in mysql, we can install the php-mysql software package. It is a good idea to install some other php5 modules and applications you may need:
Copy codeThe code is as follows:
Apt-cache search php5
You also need to install
Copy codeThe code is as follows:
Apt-get install php5-mysql php5-curl php5-gd php5-idn php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp
Restart apache
Copy codeThe code is as follows:
/Etc/init. d/apache2 restart
Install phpmyadmin
Copy codeThe code is as follows:
Apt-get install phpmyadmin
Automatically install phpMyAdmin under/usr/share/phpMyAdmin, copy phpmyadmin to the/var/www directory, and run http: // localhost/phpMyAdmin/