1.安装MySQL
yum install mysql-server –y
2.安装Apache
yum install httpd –y
3.安装PHP模块
yum install php-mysql php-gd php-imap php-odbc php-pear php-xml php-xmlrpc php-mcrypt php-mbstring –y
 
4.配置Apache
vi /etc/httpd/conf/httpd.conf
 
DirectoryIndex index.php index.html index.html.var
 
5.配置PHP
vi /etc/php.ini
 
memory_limit=128M
 
post_max_size=8M
 
upload_max_filesize=2M
 
6.MYSQL、Apache2自动启动
chkconfig mysqld on
 
chkconfig httpd on
 
7.启动MYSQL、Apache2
 
service mysqld start
 
service httpd start
 
8.停止MYSQL、Apache2
 
service mysqld stop
 
service httpd stop
 
mysql修改密码
mysqladmin -uroot password root