Install lamp:
New --> edit --> use the task group to mark the software package --> hook "lamp server" and install it again.
Add the following in Apache. conf:
$ Sudo gedit/etc/apache2/apache2.conf
Add (last added ):
Addtype application/X-httpd-PHP. php. htm. html
Addtype application/X-httpd-PHP-source. PHPs
Add the following content to PhP. ini to make PHP and MySQL work together:
$ Sudo gedit/etc/PhP5/apache2/PHP. ini
Add the following in dynamic extension:
Extension = mysql. So
Extension = Gd. So
Test whether MySQL has been installed:
$ Mysqladmin-u Root Password New Password
Command Line Logon:
$ Mysql-u root-P
Enter password:
Welcome to the MySQL monitor.
....
Mysql>
The MySQL installation is successful.
Test the combination of MySQL and PHP:
Create a new file, new. php, and place it in the/var/www/directory. The file content is as follows:
View plaincopy to clipboardprint?
<HTML>
<Head>
<Title>
Test PhP5
</Title>
<Body>
<? PHP phpinfo ();?>
</Body>
</Html>
<HTML>
<Head>
<Title>
Test PhP5
</Title>
<Body>
<? PHP phpinfo ();?>
</Body>
</Html>
Enter http: // 127.0.0.1/New. php or http: // localhost/New. php in the browser.
Install phpMyAdmin:
$ Sudo apt-Get install phpMyAdmin
PhpMyAdmin is installed in/usr/share/phpMyAdmin by default.
Make a link to the/usr/www/directory:
$ Sudo ln-S/usr/share/phpMyAdmin // usr/www/
Test:
Http: // 127.0.0.1/phpMyAdmin or http: // localhost/phpMyAdmin
Log on to the MySQL root account and password.
================= Reference ======================================== ============================================
Http://hi.baidu.com/qxf996/blog/item/6b534d54ffb8cc52564e0086.html
Install Apache: sudo apt-Get install apache2
Install PHP: sudo apt-Get install PhP5
Sudo apt-Get install php5-mysql
Install MYSQL: sudo apt-Get install mysql-server mysql-Client
Install phpgd Library: $ sudo apt-Get install php5-gd ####
Create a PHP file in the root directory: sudo gedit/var/www/testphp. php
To make PHP and MySQL work together, Edit
Sudo gedit/etc/PhP5/apache2/PHP. ini
Uncomment; Extension = mysql. So
Install the phpMyAdmin command:
Sudo apt-Get install phpMyAdmin
Installed in/usr/share/phpMyAdmin by default
Make a link to the/var/www/directory and run the following command: sudo ln-S/usr/share/phpMyAdmin // var/www/
You can use http: // localhost/phpMyAdmin to access it.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/stamhe/archive/2009/02/23/3919556.aspx