(OK) Install php 5.6 in fedora-27



#-------------------------------------------- begin -use
# 执行下面两条命令即可安装 php 5.6 in fedora-27
#--------------------------------------------

# REMI Repository , REMI Collet maintains latest version of MySQL and PH
# https://www.2daygeek.com/install-enable-remi-repository-on-centos-rhel-fedora/
# 下面是 php56 的 repository used by dnf
rpm -ivh https://rpms.remirepo.net/fedora/27/remi/x86_64/remi-release-27-1.fc27.remi.noarch.rpm
dnf install http://rpms.famillecollet.com/fedora/remi-release-27.rpm

gedit /etc/yum.repos.d/remi.repo
  enabled=1

dnf repolist                    # to check whether REMI Repository is Enabled or not
dnf --enablerepo=remi list php            # to Check whether the package is available from REMI Repository
dnf --enablerepo=remi install php        # to install package from REMI Repository
dnf info php                    # to Check whether the package is installed from REMI Repository
dnf --enablerepo=remi list available | more    # to list out the packages available from REMI Repository

dnf --enablerepo=remi install php56        # install php 5.6
# dnf remove php56*


dnf install php*            # install php 7.1
dnf install php                # install php 7.1

dnf remove remi-release
#-------------------------------------------- end -use



上次元数据过期检查:2:54:25 前,执行于 2017年11月25日 星期六 19时41分51秒。
依赖关系解决。
======================================================================================================================================================
 软件包                                       架构                     版本                                      仓库                            大小
======================================================================================================================================================
安装:
 php56                                        x86_64                   2.3-1.fc27.remi                           @commandline                   7.8 k
 php56-php-cli                                x86_64                   5.6.32-1.fc27.remi                        @commandline                   2.7 M
 php56-php-common                             x86_64                   5.6.32-1.fc27.remi                        @commandline                   699 k
 php56-php-devel                              x86_64                   5.6.32-1.fc27.remi                        @commandline                   620 k
 php56-php-gd                                 x86_64                   5.6.32-1.fc27.remi                        @commandline                    74 k
 php56-php-ldap                               x86_64                   5.6.32-1.fc27.remi                        @commandline                    64 k
 php56-php-mbstring                           x86_64                   5.6.32-1.fc27.remi                        @commandline                   530 k
 php56-php-mcrypt                             x86_64                   5.6.32-1.fc27.remi                        @commandline                    56 k
 php56-php-mysqlnd                            x86_64                   5.6.32-1.fc27.remi                        @commandline                   193 k
 php56-php-pdo                                x86_64                   5.6.32-1.fc27.remi                        @commandline                   108 k
 php56-php-pear                               noarch                   1:1.10.5-2.fc27.remi                      @commandline                   360 k
 php56-php-pecl-apcu                          x86_64                   4.0.11-2.fc27.remi                        @commandline                    67 k
 php56-php-pecl-jsonc                         x86_64                   1.3.10-2.fc27.remi                        @commandline                    50 k
 php56-php-pecl-jsonc-devel                   x86_64                   1.3.10-2.fc27.remi                        @commandline                    37 k
 php56-php-pecl-zip                           x86_64                   1.15.1-2.fc27.remi                        @commandline                    46 k
 php56-php-process                            x86_64                   5.6.32-1.fc27.remi                        @commandline                    68 k
 php56-php-soap                               x86_64                   5.6.32-1.fc27.remi                        @commandline                   174 k
 php56-php-xml                                x86_64                   5.6.32-1.fc27.remi                        @commandline                   171 k
 php56-runtime                                x86_64                   2.3-1.fc27.remi                           @commandline                   1.1 M
正在安装安装依赖关系:
 libmcrypt                                    x86_64                   2.5.8-21.fc27                             fedora                         107 k
 libzip                                       x86_64                   1.3.0-1.fc27                              fedora                          65 k
 t1lib                                        x86_64                   5.1.2-21.fc27                             fedora                         173 k

事务概要
======================================================================================================================================================
安装  22 软件包

总计:7.4 M
总下载:345 k
安装大小:24 M
确定吗?[y/N]:y



#---------------------------- begin - no use
# 也可以通过 rpm packets 安装 php5.6
cd /opt/tools/php5.6
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-cli-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-common-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-pear-1.10.5-2.fc27.remi.noarch.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-runtime-2.3-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-2.3-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-mcrypt-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-pdo-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-ldap-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-process-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-soap-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-mbstring-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-devel-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-pecl-apcu-4.0.11-2.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-mysqlnd-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-gd-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-xml-5.6.32-1.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-pecl-jsonc-1.3.10-2.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-pecl-zip-1.15.1-2.fc27.remi.x86_64.rpm
wget -c http://rpms.famillecollet.com/fedora/27/remi/x86_64/php56-php-pecl-jsonc-devel-1.3.10-2.fc27.remi.x86_64.rpm


wget -c http://dl.fedoraproject.org/pub/fedora/linux/releases/27/Everything/x86_64/os/Packages/t/t1lib-5.1.2-21.fc27.x86_64.rpm
wget -c http://dl.fedoraproject.org/pub/fedora/linux/releases/27/Everything/x86_64/os/Packages/l/libmcrypt-2.5.8-21.fc27.x86_64.rpm
wget -c http://dl.fedoraproject.org/pub/fedora/linux/releases/27/Everything/x86_64/os/Packages/l/libzip-1.3.0-1.fc27.x86_64.rpm

# install
rpm -ivh t1lib-5.1.2-21.fc27.x86_64.rpm libmcrypt-2.5.8-21.fc27.x86_64.rpm libzip-1.3.0-1.fc27.x86_64.rpm

rpm -ivh php56-php-pdo-5.6.32-1.fc27.remi.x86_64.rpm php56-php-pear-1.10.5-2.fc27.remi.noarch.rpm php56-2.3-1.fc27.remi.x86_64.rpm php56-php-pecl-apcu-4.0.11-2.fc27.remi.x86_64.rpm php56-php-cli-5.6.32-1.fc27.remi.x86_64.rpm php56-php-pecl-jsonc-1.3.10-2.fc27.remi.x86_64.rpm php56-php-common-5.6.32-1.fc27.remi.x86_64.rpm php56-php-pecl-jsonc-devel-1.3.10-2.fc27.remi.x86_64.rpm php56-php-devel-5.6.32-1.fc27.remi.x86_64.rpm php56-php-pecl-zip-1.15.1-2.fc27.remi.x86_64.rpm php56-php-gd-5.6.32-1.fc27.remi.x86_64.rpm php56-php-process-5.6.32-1.fc27.remi.x86_64.rpm php56-php-ldap-5.6.32-1.fc27.remi.x86_64.rpm php56-php-soap-5.6.32-1.fc27.remi.x86_64.rpm php56-php-mbstring-5.6.32-1.fc27.remi.x86_64.rpm php56-php-xml-5.6.32-1.fc27.remi.x86_64.rpm php56-php-mcrypt-5.6.32-1.fc27.remi.x86_64.rpm php56-runtime-2.3-1.fc27.remi.x86_64.rpm php56-php-mysqlnd-5.6.32-1.fc27.remi.x86_64.rpm

# uninstall
rpm -e php56-php-pdo php56-php-pear php56 php56-php-pecl-apcu php56-php-cli php56-php-pecl-jsonc php56-php-common php56-php-pecl-jsonc-devel php56-php-devel php56-php-pecl-zip php56-php-gd php56-php-process php56-php-ldap php56-php-soap php56-php-mbstring php56-php-xml php56-php-mcrypt php56-runtime php56-php-mysqlnd

rpm -e t1lib libmcrypt libzip

ln -s /usr/bin/php56 /usr/bin/php
ln -s /usr/bin/php56-cgi /usr/bin/php-cgi
#---------------------------- end - no use


原文地址:https://www.cnblogs.com/ztguang/p/12644501.html