Ubuntu PHP environment quick configuration installation Apache2: sudoapt-getinstallapache2 install PHP module: sudoapt-getinstallphp5 edit test page :() sudogedit/var/www/testphp. php install Mysqlsudoapt-getinstallmysql-servermysqladmin
Quick configuration of PHP environment in Ubuntu
Install Apache2:
Sudo apt-get install apache2
Install the PHP module:
Sudo apt-get install php5
Edit test page :()
Sudo gedit/var/www/testphp. php
Install Mysql
Sudo apt-get install mysql-server
Mysqladmin-u root-p password Change password
Install the Mysql Module
Sudo apt-get install libapache2-mod-auth-mysql
Sudo apt-get install php5-mysql
Sudo apt-get install php5-gd
Sudo/etc/init. d/apache2 restart
Configure php. ini:
Sudo gedit/etc/php5/apache2/php. ini
Put the file behind the file:
# Extension = mysql. so
# Extension = gd. so
.
Install phpmyadmin
Sudo apt-get install phpmyadmin
Test: htt p: // localhost/phpmyadmin/
Map URLs to other directories
Sudo gedit/etc/apache2/conf. d/alias
Restart apache
Sudo/etc/init. d/apache2 restart
======================================
Phpmyadmin is not installed under/var/www by default, but in/usr/share/phpmyadmin
You can copy phpmyadmin or create a link and copy the link.
Run sudo gedit/etc/phpmyadmin/apache in the terminal. conf and change the path of the following two sentences to/var/www/phpmyadmin (because I have configured the environment, I forgot how to write the default configuration in phpmyadmin .. There are two sentences in the third and fourth rows. If I remember correctly, it should be as follows)
Alias/phpmyadmin/usr/share/phpmyadmin
Changed:
Alias/phpmyadmin/var/www/phpmyadmin
1. Restart apache
Sudo/etc/init. d/apache2 restart
2. Restart mysql
Sudo/etc/init. d/mysql restart
Now that the LAMP environment is successfully configured, try echo phpinfo!
======================================
Apache configuration file path/etc/apache2/apache2.conf
Php. ini path/etc/php5/apache2/php5.ini
Mysql configuration file path/etc/mysql/my. cnf
Phpmyadmin configuration file path/etc/phpmyadmin/apache. conf
Website root directory/var/www