skip to Main Content

I’m running Plesk Version 17.0.17 Update #16 on Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux

My problem is that I cant figure out how to update the global PHP version to 7.1 through Plesk

I need to do this as it is required by a package I am trying to install with Composer.

I cannot remove it because it says that “Plesk is using the old version to run” and I cant seem to change the version that Plesk uses. I can only set it for individual websites and I’m not interested in running more than one PHP version.

I have already installed the new version and I am able to run it when I create a symbolic link like this:

ln -s /opt/plesk/php/7.1/bin/php /usr/bin/php

When I do this everything works fine and the problem only occurs when Plesk updates it and overwrites the path causing me to have to do it again.

I cant just remove the old version through Plesk as it says it conflicts with Plesk itself as it uses it to run.

enter image description here

enter image description here

Summary:

I want Plesk to run PHP version 7.1 and remove the old version completely.
How can I do this?

3

Answers


  1. Use this:

    apt-get update; apt-get install php{X};
    

    where {X} = version ex. 5

    For PHP 5.5, PHP 5.6 and PHP 7.0:

    apt-get update; apt-get install php{X};

    Then update the package lists and perform the upgrade:

    sudo apt-get update

    Login or Signup to reply.
  2. Well you should make sure that no website is using the old php version. After that you should be able to remove the old php version from Plesk. You should not have to create a symbolic link manually. That can cause problems with Plesk.

    Login or Signup to reply.
  3. Maybe better to said composer use specific PHP binary?

    For example you can just add the following line into the .bashrc file from your user folder:

    export PATH=/opt/plesk/php/7.1/bin:$PATH
    

    Or

    echo 'PATH=/opt/plesk/php/7.1/bin:$PATH' >> ~/.bashrc
    

    To verify you have to relogin/recreate bash session and check $PATH variable:

    echo $PATH
    /opt/plesk/php/7.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search