Linux下yum快速配置LAMP编程环境

1、安装Apache

yum install httpd httpd-devel

安装完成后,启动apache

/etc/init.d/httpd start

永久关闭防火墙:

chkconfig --level 35 iptables off

设为开机启动:

chkconfig httpd on

2、安装mysql

yum install mysql mysql-server mysql-devel

同样,完成后,启动mysql

/etc/init.d/mysqld start

3、设置mysql的root用户密码

mysql>USE mysql;
mysql>UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql>FLUSH PRIVILEGES;

4、允许远程登录

mysql -u root -p
mysql>GRANT ALL PRIVILEGES ON *.* TO ' 用户名 '@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;

5、设为开机启动

chkconfig mysqld on

6、安装php

yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml