First, install the Apache2
#yum-y Install httpd
Installation configuration complete, start httpd service
#service httpd Start
Second, install MySQL
1. Install MySQL
#yum-y Install Mysql-server
When the installation is complete, start the MySQL service:
#service mysqld Start
2. Configure the password for the root of MySQL super User:
#usr/bin/mysqladmin-u root password ' 123456 '
Use the command to test for the correct password after you modify it:
#mysql-U root-p123456
3. Set the default database encoding, log in to MySQL with the root user, enter status to view the default settings:
mysql>status;
Server Characterset:utf8
Db Characterset:utf8
Client characterset:latin1
Conn. Characterset:latin1
Modify the UTF8 encoding for all:
#vi/etc/my.cnf
Add after [MYSQLD] Block: Default-character-set=utf8
Add after [MySQL] block: Default-character-set=utf8
If [MySQL] can add itself at the end, then add the character encoding statement.
Sometimes found in this file only [mysqld] and [Mysqld_safe], can be added at the end
[Client]
Default-character-set=utf8
Then restart service mysqld stop
Service mysqld Start
Third, install PHP
#yum-y Install PHP
Iv. Configuring additional extension components
The following installation includes PHP MySQL and GD extensions are often used, be sure to install, the other can choose to install
#yum-y install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
Install the above content, restart Apache, check the test page output information to see if the configuration is correct.
uninstalling Apache MySQL PHP
In fact, like uninstalling other software (the Yum method is installed):
Yum-y Remove httpd
Yum-y Remove httpd*
Yum-y Remove Mysqld
Yum-y Remove mysqld*
Yum-y Remove PHP
Yum-y Remove PHP-GD
Yum-y Remove MySQL