Setup under Ubuntu (linux+apache+mysql+php, LAMP) environment

Source: Internet
Author: User
Tags curl install php phpmyadmin

recently started to play PHP, so try to build a development environment and make a record, in case you can use it later to be easily checked. The first step is to ensure that the package is up to date
<span style= "FONT-SIZE:18PX;" >sudo Apt-get update</span>
Step two install Apache2
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install apache2</span>
Test after installation: Open http://localhost/or http://127.0.0.1 in the browser If it works!, it proves the Apache installation was successful.
Second step to install MySQL
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install mysql-server</span>
the root password needs to be set during installation
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install mysql-client</span>
Step three install PHP
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install php5</span>
Fourth Step other module installation
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install libapache2-mod-php5</span>
let Apache, PHP support MySQL
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install libapache2-mod-auth-mysql</span>
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install php5-mysql</span>
<span style= "FONT-SIZE:18PX;" >sudo/etc/init.d/apache2 restart</span>
GD Library Installation: Image library, such as generate verification code, processing pictures are inseparable from it
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install php5-gd</span>
Curl Extension Installation: Supports ftp,http and so on protocol. It's easy to use.
<span style= "FONT-SIZE:18PX;" >sudo apt-get Install Php5-curl </span>
<span style= "FONT-SIZE:18PX;" >sudo/etc/init.d/apache2 restart</span>
Fifth Step Modify permissions
Because most of the lamp operation is related to the/var/www directory, for convenience, the permission to modify the directory is accessible to ordinary users.
<span style= "FONT-SIZE:18PX;" >sudo chmod 777/var/www/</span>
Sixth Step installation phpMyAdminPhpMyAdmin is a PHP-based, web-enabled MySQL database management tool that allows administrators to manage MySQL databases in a web interface
<span style= "FONT-SIZE:18PX;" >sudo Apt-get Install phpmyadmin</span>
Select Apache2 during installation
The seventh step is to establish a connection between phpMyAdmin and Apache2Note: www directory in/var/www,phpmyadmin in/usr/share/phpmyadmin directory
<span style= "FONT-SIZE:18PX;" >sudo ln-s/usr/share/phpmyadmin/var/www</span>
test: Run Http://localhost/phpmyadmin directly to see if there is any database management software presentEnter your user name and password and log inEighth step PHP testCreate a new file under the/var/www directory test.php
<span style= "FONT-SIZE:18PX;" >sudo Touch test.php</span>
and write in the file:
<span style= "FONT-SIZE:18PX;" ><? PHP     phpinfo ();    ? ></span>
Save the file. nineth Step Test php You can see the system Information of PHP by entering http://localhost/test.php in the browser.
This completes the Lamp development environment configuration under Ubuntu.






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.