Install PHP under Ubuntu
Installing the Apache2:sudo apt-get install apache2. To see if it was successful: http://localhost/
Installing Php5:sudo apt-get Install PHP5
sudo apt-get install libapache2-mod-php5 (according to my actual test, this step does not seem to be done, in the previous step has been installed, but it is recommended that you copy/paste this command)
Sudo/etc/init.d/apache2 Restart test if the PHP5 installation was successful
sudo gedit/var/www/testphp.php
Write in, then open in Firefox: http://localhost/testphp.php
Installing Mysql:sudo apt-get Install Mysql-server
MySQL initially allows only native (127.0.0.1) connections, and if you want to use multiple machines or open to the Internet, edit/etc/mysql/my.cnf
sudo gedit/etc/mysql/my.cnf
Find bind-address = 127.0.0.1, comment out with #, like this: #bind-address = 127.0.0.1
MySQL default does not set the root password, the root user of this machine has no password, there is a risk, right, so
Mysqladmin-u Root Password Your-new-password
Mysqladmin-h root@local-machine-name-u root-p Password Your-new-password (here I can not connect to MySQL server, finally changed in Mysql-admin)
Sudo/etc/init.d/mysql restart
Installing MySQL administrator:sudo apt-get install mysql-admin
Installing MySQL for Apache HTTP Server
sudo apt-get install Libapache2-mod-auth-mysql
sudo apt-get install Php5-mysql
(sudo apt-get install phpmyadmin)
To have PHP work with MySQL, edit
sudo gedit/etc/php5/apache2/php.ini
To cancel a comment on; extension=mysql.so, like this.
...
Extension=mysql.so
...
Save the file, and then
Sudo/etc/init.d/apache2 restart
Test:
Http://localhost/phpmyadmin