安装 PHP5.6

说明一下,该yum源里面php5.x到php7.x都有,各种扩展齐全,心动有木有。

php5.6安装

CentOS 6.5的epel及remi源

# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

以下是CentOS 7.0的源。

# yum install epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

使用yum list命令查看可安装的包:

# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

安装PHP5.6

# yum -y install --enablerepo=remi --enablerepo=remi-php56 php-bcmath php-cli php-common php-devel php-fpm php-mbstring php-gd php-mcrypt php-mysqlnd  php-pdo php-pecl-swoole2 php-pecl-swoole2-devel  php-pecl-redis php-posix php-yaf php-soap php-opcache

查看版本

# php -v
PHP 5.6.30 (cli) (built: Jan 19 2017 08:09:42) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

查看扩展:

# php -m
[PHP Modules]
bcmath
bz2
calendar
......
swoole
sysvmsg
sysvsem
sysvshm
tokenizer
yaf
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

php7安装

# 功能:php程序安装
yum -y install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum -y install --enablerepo=remi --enablerepo=remi-php72 php-bcmath php-cli php-common php-devel php-fpm php-mbstring php-gd php-mcrypt php-mysqlnd  php-pdo php-pecl-redis php-posix php-yaf php-soap php-opcache
# Swoole-1.x需要 PHP-5.3.10 或更高版本
# Swoole-2.x需要 PHP-7.0.0 或更高版本
# Swoole-4.x需要 PHP-7.1.0 或更高版本
yum -y install --enablerepo=remi --enablerepo=remi-php72 php-pecl-swoole2 php-pecl-swoole2-devel
php -v

你可能感兴趣的:(安装 PHP5.6)