centos6.6学习笔记:安装PHP5.5

更新源

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!

MySql密码设置完成,重新启动 MySQL:

/etc/init.d/mysqld restart #重启
/etc/init.d/mysqld stop #停止
/etc/init.d/mysqld start #启动

三 、安装php
1.查询是否安装有php

rpm -qa|grep php

2.删除之前安装的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 
    原文作者:kingHalo丶一文
    原文地址: https://segmentfault.com/a/1190000008902432
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞