Programming language Select PHP5, Web server select Apache2, background database select MySQL
First install the build tool, open the terminal
sudo apt-get install build-essential autoconf automake1.9 CVS Subversion (try it whether you've installed it or not)
Installation of Apache
sudo apt-get install Apache5
Installation of PHP5
sudo apt-get install php5
Installation of MySQL in PHP5 environment
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
MySQL start/stop/restart
Sudo/etc/init.d/mysql start
Sudo/etc/init.d/mysql stop
Sudo/etc/init.d/mysql restart
Set root password after Mysql installation
Mysql-uroot (the root user's password is empty at first, so you can go in if you set the password in the interface when you install it.)
Can skip this step)
Go to the MySQL console:
Set password for ' root ' @ ' localhost ' =password (' YourPassword ');
If successful, MySQL tip: Query OK 0rows affected (0.00SEC)
Setup Complete Configuration
sudo gedit/etc/apach2/apach2.conf configuring Apache server
sudo gedit/etc/php5/apach2/php.ini configuration php is found in the text box "; Extension=mysql.so ", remove; indicate Apache startup
Load the module with the MySQL connection, then save and restart the Apache server.
In the/var/www directory is the home directory of Apache, new *.php input <? Phpinfo ();?> Save exit
In the Firefox address bar, enter: http://localhost/*.php run if successful, the build is complete.
Ubuntu under PHP mysql environment build-upcoming-chinaunix blog