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 datesudo apt-get updateStep two install Apache2sudo apt-get install apache2Test after installation: Open http://localhost/or http://127.0.0.1 in the browserIf there is an IT works! It proves the Apache installation was successful.
Second step to install MySQL
sudo apt-get install mysql-serverthe root password needs to be set during installationsudo apt-get install mysql-clientStep three install PHPsudo apt-get install php5Fourth Step other module installationsudo apt-get install libapache2-mod-php5let Apache, PHP support MySQLsudo apt-get install libapache2-mod-auth-mysqlsudo apt-get install php5-mysqlsudo/etc/init.d/apache2 RestartGD Library Installation: Image library, such as generate verification code, processing pictures are inseparable from itsudo apt-get install PHP5-GDCurl Extension Installation: Support Ftp,http and so on protocol, easy to use.sudo apt-get install Php5-curlsudo/etc/init.d/apache2 RestartFifth 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. sudo chmod 777/var/www/Sixth Step installation phpMyAdminphpMyAdmin is a MySQL database management tool based on PHP that is web-architected on a Web site host, allowing administrators to manage the MySQL database using a Web interface. sudo apt-get install phpMyAdminSelect Apache2 during installationThe seventh step is to establish a connection between phpMyAdmin and Apache2Note: www directory in/var/www,phpmyadmin in/usr/share/phpmyadmin directorysudo ln-s/usr/share/phpmyadmin/var/wwwtest: 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.phpsudo touch test.phpand write in the file:<? phpPhpinfo (); ?>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.
Setup under Ubuntu (linux+apache+mysql+php, LAMP) environment