安装指定的php版本
参考:https://webtatic.com/packages/php55/
查询是否安装有php
更新源
查看php版本列表
安装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://webtatic.com/packages/php55/
查询是否安装有php
- #rpm -qa|grep php
如果有安装的PHP包,先删除他们
#yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php- mysql.x86_64 php-pdo.x86_64
删除之前安装的php版本 (yum install 安装)
- #rpm -e php-fpm-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-common-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-cli-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-odbc-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-xml-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-pear-1.9.4-5.el6.noarch --nodeps
- #rpm -e php-mbstring-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-ldap-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-bcmath-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-pecl-redis-2.2.8-1.el6.x86_64 --nodeps
- #rpm -e php-pdo-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-gd-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-mysql-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-xmlrpc-5.3.3-47.el6.x86_64 --nodeps
- #rpm -e php-pecl-igbinary-1.2.1-1.el6.x86_64 --nodeps
更新源
- #rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
- #rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
查看php版本列表
- #yum list php*
安装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