CentOS yum按照制定版本PHP

安装软件源

1.添加epel源

1

2

[root@opstrip.com opt]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

[root@opstrip.com opt]# rpm -Uvh http://mirrors.rit.edu/fedora/epel//7/x86_64/e/epel-release-7-9.noarch.rpm

1

[root@opstrip.com opt]# rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

安装并更新软件

安装yum-config-manager实用程序

1

[root@opstrip.com opt]# yum -y install yum-utils

更新完成后,开始安装所需要的PHP。

安装PHP

对于PHP5

1

[root@opstrip.com opt]# yum -y install php

对于PHP7.0

1

2

[root@opstrip.com opt]# yum-config-manager --enable remi-php70

[root@opstrip.com opt]# yum -y install php php-opcache

对于PHP7.1

1

2

[root@opstrip.com opt]# yum-config-manager --enable remi-php71

[root@opstrip.com opt]# yum -y install php php-opcache

[root@localhost logs]# yum-config-manager --enable remi-php71                                                                                              
已加载插件:fastestmirror, product-id, subscription-manager                                                                                                      
                                                                                                                                                           
This system is not registered with an entitlement server. You can use subscription-manager to register.                                                    
                                                                                                                                                           
==================================================================== repo: remi-php71 =====================================================================
[remi-php71]                                                                                                                                               
async = True                                                                                                                                               
bandwidth = 0                                                                                                                                              
base_persistdir = /var/lib/yum/repos/x86_64/7                                                                                                              
baseurl =                                                                                                                                                  
cache = 0                                                                                                                                                  
cachedir = /var/cache/yum/x86_64/7/remi-php71                                                                                                              
check_config_file_age = True                                                                                                                               
compare_providers_priority = 80                                                                                                                            
cost = 1000                                                                                                                                                
deltarpm_metadata_percentage = 100                                                                                                                         
deltarpm_percentage =                                                                                                                                      
enabled = True                                                                                                                                             
enablegroups = True                                                                                                                                        
exclude =                                                                                                                                                  
failovermethod = priority                                                                                                                                  
ftp_disable_epsv = False                                                                                                                                   
gpgcadir = /var/lib/yum/repos/x86_64/7/remi-php71/gpgcadir                                                                                                 
gpgcakey =                                                                                                                                                 
gpgcheck = True                                                                                                                                            
gpgdir = /var/lib/yum/repos/x86_64/7/remi-php71/gpgdir                                                                                                     
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi                                                                                                          
hdrdir = /var/cache/yum/x86_64/7/remi-php71/headers                                                                                                        
http_caching = all                                                                                                                                         
includepkgs =                                                                                                                                              
ip_resolve =                                                                                                                                               
keepalive = True                                                                                                                                           
keepcache = False                                                                                                                                          
mddownloadpolicy = sqlite                                                                                                                                  
mdpolicy = group:small                                                                                                                                     
mediaid =                                                                                                                                                  
metadata_expire = 21600                                                                                                                                    
metadata_expire_filter = read-only:present                                                                                                                 
metalink =                                                                                                                                                 
minrate = 0                                                                                                                                                
mirrorlist = http://cdn.remirepo.net/enterprise/7/php71/mirror                                                                                             
mirrorlist_expire = 86400                                                                                                                                  
name = Remi's PHP 7.1 RPM repository for Enterprise Linux 7 - x86_64                                                                                       
old_base_cache_dir =                                                                                                                                       
password =                                                                                                                                                 
persistdir = /var/lib/yum/repos/x86_64/7/remi-php71                                                                                                        
pkgdir = /var/cache/yum/x86_64/7/remi-php71/packages                                                                                                       
proxy = False                                                                                                                                              
proxy_dict =                                                                                                                                               
proxy_password =                                                                                                                                           
proxy_username =                                                                                                                                           
repo_gpgcheck = False                                                                                                                                      
retries = 10                                                                                                                                               
skip_if_unavailable = False                                                                                                                                
ssl_check_cert_permissions = True                                                                                                                          
sslcacert =                                                                                                                                                
sslclientcert =                                                                                                                                            
sslclientkey =                                                                                                                                             
sslverify = True                                                                                                                                           
throttle = 0                                                                                                                                               
timeout = 30.0                                                                                                                                             
ui_id = remi-php71                                                                                                                                         
ui_repoid_vars = releasever,                                                                                                                               
   basearch                                                                                                                                                
username =                                                                                                                                                 
                                                                                                                                                           
[root@localhost logs]#   yum -y install php php-opcache                                                                                                                                

还需要添加PHP常用扩展:

1

[root@opstrip.com opt]# yum -y install php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值