How to install Nextcloud 18 (php problem despite PhpSwitcher)

  • Maybe really a silly question - but I just can't get Nextcloud 18 installed. It requires minimum php 7.2.


    I have installed and added to PhpSwitcher php 7.3, and put it active for the domain in question. Otherwise, there is just the standard php 7.1 installed.


    Still on the console php -v only shows php 7.1.


    And when I come to this step of upgrading my Nextcloud installation:

    Code
    1. sudo -u vu2004 ./occ upgrade

    I get

    Code
    1. This version of Nextcloud requires at least PHP 7.2<br/>You are currently running 7.1.33-15+0~20200419.36+debian9~1.gbp2384b3. Please update your PHP version.

    Any suggestions how to proceed?


    Many thanks for advice

    Chris


    Debian 9

    i-MSCP 1.5.3

    PhpSwitcher 5.0.5

    Other plugins in the most recent versions (fresh install): LetsEncrypt, Mailman, OpenDKIM, RoundcubePlugins, SpamAssassin

  • Great quick solution provided by kess . A bit different, but a more permanent solution, is to setup your terminal to always use the PHP version to match the version you have installed via PHPSwitcher. This can be achieved by opening a SSH terminal and logging in with your domain username and execute the following:


    Create a profile file:

    touch ~/.profile


    Open that file:

    nano ~/.profile


    Add this line to file: (Use directory structure from your system to match PHP Versions you have installed)

    export PATH=/opt/phpswitcher/YYYYMMDD/phpX.X/bin:$PATH

    Save and Exit nano


    Load your profile:

    source ~/.profile


    Check your PHP Version:

    php -v


    If all went smoothly, you should be using the same version of PHP you chose in GUI for your domain in your terminal now. Your PHP Version will stay persistent every time you open a new terminal session. You shouldn't have to worry about it again until you change PHP Versions in the future.

    “Life is all an Elaborate Hoax”