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.