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: 
    
  • 相关阅读:
    int len=50;len = Integer.valueOf(str.substring(j+1)).intValue()
    session创建问题
    beginner3
    begineer2
    好博客1
    Struts2之两个Action传值和不传值的struts.xml文件配置
    什么是超融合 To
    Python赢得TIOBE 2010年度语言大奖 狼人:
    WPS/WESB绑定:玩转EJB绑定 狼人:
    10个奇幻的HTML5和Javascript效果 狼人:
  • 原文地址:https://www.cnblogs.com/shu-sheng/p/14448365.html
Copyright © 2011-2022 走看看