zoukankan      html  css  js  c++  java
  • 在已安装的PHP版本之间切换

    有两种方法:Apache2、CLI

    Apache2

    root@cky_test01:~# cd /etc/apache2/
    root@cky_test01:/etc/apache2# ls -l mods-*/*php*
    -rw-r--r-- 1 root root 867 Jan 12 06:03 mods-available/php5.6.conf
    -rw-r--r-- 1 root root 102 Jan 12 06:03 mods-available/php5.6.load
    -rw-r--r-- 1 root root 855 Oct  7 11:24 mods-available/php7.2.conf
    -rw-r--r-- 1 root root 102 Oct  7 11:24 mods-available/php7.2.load
    lrwxrwxrwx 1 root root  29 Dec 20 20:59 mods-enabled/php7.2.conf -> ../mods-available/php7.2.conf
    lrwxrwxrwx 1 root root  29 Dec 20 20:59 mods-enabled/php7.2.load -> ../mods-available/php7.2.load
    
    # 禁用
    root@cky_test01:/etc/apache2# a2dismod php7.2
    root@cky_test01:/etc/apache2# a2disconf php7.2-cgi
    # 启用
    root@cky_test01:/etc/apache2# a2enmod  php5.6
    root@cky_test01:/etc/apache2# a2disconf php5.6-cgi
    
    root@cky_test01:/etc/apache2# systemctl restart apache2
    

    CLI

    root@cky_test01:/etc/apache2# update-alternatives --set php /usr/bin/php5.6 
    update-alternatives: using /usr/bin/php5.6 to provide /usr/bin/php (php) in manual mode
    
    # 或者
    
    root@cky_test01:/etc/apache2# update-alternatives --config php
    There are 2 choices for the alternative php (providing /usr/bin/php).
    
      Selection    Path             Priority   Status
    ------------------------------------------------------------
      0            /usr/bin/php7.2   72        auto mode
    * 1            /usr/bin/php5.6   56        manual mode
      2            /usr/bin/php7.2   72        manual mode
    
    Press <enter> to keep the current choice[*], or type selection number: 
    
  • 相关阅读:
    神经网络(2)---neurons and the brain
    P2P system:How Chord tackles failures
    如何成为更好的自己
    P2P system: Chord
    P2P system: FastTrack and BitTorrent
    P2P system: GNUTELLA
    P2P system: Napster
    P2P system: Introduction
    幸福公开课(2)
    MTV与MVC 多对多表的创建方式 前后端传输数据编码格式 ajax 批量插入数据 自定义分页器
  • 原文地址:https://www.cnblogs.com/shu-sheng/p/14448365.html
Copyright © 2011-2022 走看看