3

I've had an issue for quite a while now that I don't know how to fix.

I'm running a VPS with Ubuntu 12.04 LTS, it has the latest version of Plesk (12.0.18 Update #34). Annoyingly, it only has PHP version 5.3.10 which is too old. I thought it would be fairly simple to update PHP - but it turns out it's not for some reason?

I've tried doing the following:

sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get upgrade

and then running:

/usr/local/psa/bin/php_handler --add -displayname php-5.6.2 -path /usr/bin/php5-cgi -phpini /etc/php5/fpm/php.ini -type fastcgi -id 2

I then go to hosting settings and select the new version of PHP, however nothing happens at all, the phpinfo() still reports running PHP version 5.3.10.

How do I get a better PHP version to work with Plesk?

2

I've run into this issue myself, and would recommend not using apt-get and instead installing PHP according to the directions here from Parallels for Multiple PHP Versions in Plesk on Linux:

enter image description here

Be sure to use the new version number of PHP for NN in the above so that you're installing and configuring it in a new directory and path for that version, and run the configure utility with the option --with-config-file-path=/some/path in step 3.

I would not recommend removing all versions of PHP since the control panel will no longer function or be accessible by you and your clients (it runs on PHP). Instead I'd leave the default 5.3.3 version (at the time of this post) for Plesk to use, and assign the updated version in the service plan and hosting settings for specific accounts that need an updated version of PHP:

enter image description here

Plesk will automatically update PHP for the version of PHP that it needs to function along with its other base packages. So if you follow the above, you'll be keeping the base PHP install separate and functioning with fewer potential problems than with updating it to the latest PHP version that might not work well with Plesk.

  • 1
    I discovered pretty much the only way to do it is to install all the desired components without Plesk installed and then install Plesk post update as it is a dependency for PHP. Attempting to update PHP with plesk installed results in plesk being removed and its all just pretty annoying! Your solution did fix it for me though, as my VPS is such that I get plesk with a fresh build and can't reinstall it as I don't have the license. – Matt Feb 11 '15 at 1:39
  • Yes, you could do it that way too if you don't already have accounts setup (or use their Backup Manager tool and Restore afterwards). Glad it worked for you. As a cautionary note in case you decide to also try updating MySQL, that gets even worse :-/ – dan Feb 11 '15 at 1:48
1

Rather than using <?php phpinfo(); ?> you should opt to use /usr/local/psa/bin/php_handler --list as this should list what versions of PHP you have installed. If you don't know already Plesk can handle multiple versions of PHP so you should ensure that the the latest php.ini is being used, manually overwrite old with new, but backup first. You should also restart your web server if haven't already.

If you don't want to multiple versions of PHP installed on the server then you can brute force remove them all by doing sudo apt-get -y purge php.*, take a note exactly what gets uninstalled as this will remove everything that starts with php i.e would remove php4 php5-server etc.

If you suspect that a extension has be removed as the result of the upgrade you can check by doing /usr/local/psa/admin/bin/autoinstaller --select-product-id plesk --select-release-current --show-components

  • Unless the OP is just in the setup stage of using Plesk, removing all versions of PHP would disable Plesk since it runs on PHP. It's also not recommended to update the default PHP installation since that can also break Plesk. It's better to let the auto-installer update that version automatically, and install separate versions of PHP as an option for user accounts to select. – dan Feb 9 '15 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.