Using Plesk with CloudLinux, CageFS, and PHP Selector and notice that your phpinfo() page continues to display an outdated PHP version even after you change it in Plesk? This tutorial aims to walk through why this happens and provides steps to prioritize the PHP version set in Plesk over PHP Selector.
Why the PHP Version Doesn't Update
In CloudLinux, the PHP version configured in PHP Selector takes precedence over the version set in Plesk. So, even if you modify the PHP version in Subscriptions > example_domain.com > PHP Settings, the phpinfo() page may still show the old version. This happens because PHP Selector's version setting overrides any changes you make directly in Plesk.
Resolution: How to Prioritize Plesk's PHP Version
To make sure the PHP version configured in Plesk appears correctly on your phpinfo() page, you can either set PHP to “native” in PHP Selector or switch to the PHP-FPM handler. Here's how to implement each option:
Option 1: Set PHP to "Native" in PHP Selector
- Log in to your Plesk dashboard.
- Navigate to Subscriptions > example_domain.com > PHP Selector.
- In PHP Selector, set Current PHP Version to native. This tells PHP Selector to follow the system's PHP version, which should match the version configured in Plesk.
- Apply the changes and verify by checking the
phpinfo()page again.
Option 2: Set PHP-FPM as the Handler in Plesk
- Go to Subscriptions > example_domain.com > PHP Settings in Plesk.
- Change the PHP handler to PHP-FPM.
- Click Apply and OK to save the new settings.
Note: The PHP-FPM handler is not supported by PHP Selector, so this setting will override the PHP Selector configuration, allowing Plesk to control the PHP version directly.
Important Consideration
If you are using LSPHP (a high-performance handler often used with LiteSpeed servers), please note that Plesk does not fully support LSPHP. In this case, you will need to manage the PHP version via PHP Selector to ensure compatibility.
Testing the Resolution
After making these changes, check the phpinfo() page again to confirm that the correct PHP version is displayed.
Disclaimer: Always test changes in a staging environment before applying them to your live server. For the latest guidance, refer to the official Plesk documentation and the CloudLinux documentation.