Announcement

Collapse
No announcement yet.

Multiple PHP Versions | Virtualmin | CentOS | Ubuntu | Debian

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple PHP Versions | Virtualmin | CentOS | Ubuntu | Debian

    Installing PHP 5.6 on CentOS 6 and 7

    Install the SCL Repo:

    Code:
    yum install centos-release-scl
    Install the PHP packages

    Code:
    yum install rh-php56 rh-php56-php-mysqlnd
    Lastly, see the information on configuring the second PHP version below. Installing PHP 7 on CentOS 6 and 7

    Install the SCL Repo:

    Code:
    yum install centos-release-scl
    Install the PHP packages

    Code:
    yum install rh-php70 rh-php70-php-mysqlnd
    Lastly, see the information on configuring the second PHP version below. Installing PHP 7 on Ubuntu 14.04, 16.04, 18.04

    Install the PPA:

    Code:
    add-apt-repository ppa:ondrej/php && apt-get update
    Install the PHP packages

    Code:
    apt-get install php7.0 php7.0-mysql php7.0-cgi php7.0-cli
    Reset the default PHP back to PHP5 (optional)

    Code:
    update-alternatives --set php /usr/bin/php5

    Installing Different PHP versions on Debian 8, 9

    Run below commands to upgrade the current packages to the latest version.

    Code:
    sudo apt update 
    sudo apt upgrade

    Let’s execute the following commands to install the required packages first on your system. Then import packages signing key. After that configure PPA for the PHP packages on your system.


    Code:
    sudo apt install ca-certificates apt-transport-https 
    wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
    echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list

    Now use one of the below options to install PHP of your requirements.

    Installing PHP 5.6

    Execute the following commands for installing PHP 5.6 on your Debian 9 Stretch system.
    Code:
    sudo apt update sudo apt install php5.6
    Also install required php modules.
    Code:
    sudo apt install php5.6-cli php5.6-common php5.6-curl php5.6-mbstring php5.6-mysql php5.6-xml
    Installing PHP 7.3

    You can also install the Latest PHP version on your system. Run the following commands to install PHP 7.3 on Debian 9.
    Code:
    sudo apt update sudo apt install php7.3
    Also install required php modules.
    Code:
    sudo apt install php7.3-cli php7.3-common php7.3-curl php7.3-mbstring php7.3-mysql php7.3-xml
    Installing PHP 7.2

    You can also install the Latest PHP version on your system. Run the following commands to install PHP 7.2 on Debian 9.
    Code:
    sudo apt update sudo apt install php7.2
    Also install required php modules.
    Code:
    sudo apt install php7.2-cli php7.2-common php7.2-curl php7.2-mbstring php7.2-mysql php7.2-xml
    Installing PHP 7.1

    If your application has the specific requirement of PHP 7.1, You can use the following commands for installing PHP 7.1 on Debian 9 Stretch system.

    Code:
    sudo apt update
    sudo apt install php7.1

    Also, install the required PHP modules as per your requirements. Here is a list of some frequently used modules.

    Code:
    sudo apt install php7.1-cli php7.1-common php7.1-curl php7.1-mbstring php7.1-mysql php7.1-xml
Working...
X