1.准备工作
安装好CentOS 6.5操作系统
关闭iptables和selinux
设置好IP地址
2.安装LAMP环境
安装软件包
yum -y groupinstall "Development Tools"
yum -y install httpd mysql mysql-server mysql-devel php php-mysql php-common php-mbstring php-gd php-odbc php-pear curl curl-devel net-snmp net-snmp-devel perl-DBI php-xml ntpdate php-bcmath
启动httpd及mysql服务
/etc/init.d/httpd start
/etc/init.d/mysqld start
chkconfig httpd on
chkconfig mysqld on
配置PHP参数
注意‘=’号之前有一个空格,否则会修改失败,后面的php配置检查页面有的项目会显示failed
cp /etc/php.ini/etc/php.ini.bak_20160226
sed -i "s@;date.timezone = @date.timezone = Asia/Shanghai@g" /etc/php.ini
sed -i "s@max_execution_time = 30@max_execution_time = 300@g" /etc/php.ini
sed -i "s@post_max_size = 8M@post_max_size = 32M@g" /etc/php.ini
sed -i "s@max_input_time = 60@max_input_time = 300@g" /etc/php.ini
sed -i "s@memory_limit = 128M@memory_limit = 128M@g" /etc/php.ini
sed -i "s