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

更新源php

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm 
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

1、安装apachemysql

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
解决办法:web

vi /etc/httpd/conf/httpd.conf #编辑
ServerName www.example.com:80 #去掉前面的注释
:wq! #保存退出

chkconfig httpd on #设为开机启动
/etc/init.d/httpd restart #重启Apache

2、安装mysqlsql

一、安装MySQLapache

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,直接覆盖便可)

二、为root帐户设置密码dom

mysql_secure_installation

回车,根据提示输入Yrest

输入2次密码,回车code

根据提示一路输入Yserver

最后出现:Thanks for using MySQL!xml

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
相关文章
相关标签/搜索