网站环境搭建 apache+php+mysql

yum -y install mysql mysql-server   安装mysql服务

chkconfig mysqld on 开机自动启动mysql服务

mysqladmin -u root password 123456 设置mysql root密码


yum -y install httpd 安装apache服务

chkconfig httpd on 开机自动启动apache

service httpd start   启动apache服务


yum install php

service httpd restart


最后还要给文件赋予权限:chmod -R 777 /www/


或者一次性安装完:yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql