Build the ubuntuphplamp environment

Source: Internet
Author: User
: This article mainly introduces how to build the ubuntuphplamp environment. if you are interested in the PHP Tutorial, refer to it. Installation process
Step 1 install Apache2
Sudo apt-get install apache2
Step 2 install the PHP module
Sudo apt-get install php5
Step 3 install Mysql
Sudo apt-get install mysql-server
Sudo apt-get install mysql-client
Step 4 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
Step 5 test whether Apache works properly
Open your browser and enter localhost to check whether It Works exists! Webpage display. Directory:/var/www
Step 6 modify permissions/var/www
Sudo chomod 777/var/www
Step 7 install phpmyadmin
Sudo apt-get install phpmyadmin
Select apache2 during installation and click OK. The next step is to configure the database and enter the password.
Step 8 test phpmyadmin
Sudo ln-s/usr/share/phpmyadmin/var/www
Then run http: // localhost/phpmyadmin directly to check whether the database management software is available.
Configuration process
Step 1 enable the mod_rewrite module
Sudo a2enmod rewrite
Restart Apache Server: sudo/etc/init. d/apache2 restart or sudo service apache2 restart
Step 2: Set apacheto support .htm. html. php
Sudo gedit/etc/apache2/apache2.conf &
Add the following sentence: AddType application/x-httpd-php. php. htm. html
Step 3 test the php webpage
Edit the mysql_test.php code as follows:
$ Link = mysql_connect ("localhost", "root", "password ");
If (! $ Link)
Die ('could not connect: '. mysql_error ());
Else
Echo "Mysql configuration is correct! ";
Mysql_close ($ link );
?>
When you access http: // localhost/mysql_test.php, 'MySQL configuration is correct 'indicates that the configuration is correct.
Step 4, step 3, the solution after garbled characters appear
Open the configuration file sudo gedit/etc/apache2/apache2.conf &
Add the code below: AddDefaultCharset UTF-8
Restart apache
Sudo service apache2 restart

So far, the configuration is OK.

Original link http://blog.csdn.net/callmeback/article/details/8130190


The above describes how to set up the ubuntu php lamp environment, including some content, and hope to help those who are interested in the PHP Tutorial.

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.