更新源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
一、安装apache
yum install httpd #根据提示,输入Y安装即可成功安装
/etc/init.d/httpd start #启动Apache
Apache启动可能出现的问题:
httpd:httpd: Could not reliably determine the server's fully qualif domain name,using ::1 for ServerName
解决办法:
vi /etc/httpd/conf/httpd.conf #编辑 ServerName www.example.com:80 #去掉前面的注释 :wq! #保存退出
chkconfig httpd on #设为开机启动 /etc/init.d/httpd restart #重启Apache
二、安装MysqL
1、安装MysqL
yum install MysqL MysqL-server #询问是否要安装,输入Y即可自动安装,直到安装完成
/etc/init.d/MysqLd start #启动MysqL chkconfig MysqLd on #设为开机启动 cp /usr/share/MysqL/my-medium.cnf /etc/my.cnf #拷贝配置文件(注意:如果/etc目录下面默认有一个my.cnf,直接覆盖即可)
2、为root账户设置密码
MysqL_secure_installation
回车,根据提示输入Y
输入2次密码,回车
根据提示一路输入Y
最后出现:Thanks for using MysqL!
/etc/init.d/MysqLd restart #重启 /etc/init.d/MysqLd stop #停止 /etc/init.d/MysqLd start #启动
rpm -qa|grep PHP
remove PHP-common #注意查询的PHP版本
3.查看PHP版本列表
yum list PHP*
5.安装PHP及相关软件
yum install PHP55w.x86_64 PHP55w-fpm.x86_64 PHP55w-MysqL.x86_64 PHP55w-gd.x86_64 libjpeg* PHP55w-ldap.x86_64 PHP55w-odbc.x86_64 PHP55w-pear.noarch PHP55w-xml.x86_64 PHP55w-xmlrpc.x86_64 PHP55w-mbstring.x86_64 PHP55w-bcmath.x86_64 PHP-mhash原文链接:https://www.f2er.com/centos/378149.html