How to Change the PHP Version in a Plesk Control Panel

Change the PHP Version

Changing the PHP version in a Plesk control panel is an essential task for web administrators, as different applications and websites may require specific PHP versions to function correctly. Plesk, a popular web hosting control panel, offers a straightforward way to manage PHP versions for individual domains and subdomains. This guide will provide a detailed explanation of how to change the PHP version in Plesk, covering each step and explaining the importance of selecting the correct PHP version.

Why Change the PHP Version?

Before diving into the process, it’s important to understand why you might need to change the PHP version:

  1. Compatibility: Different websites or applications may require different PHP versions to run smoothly. Some modern applications might need the latest PHP features, while older applications might not be compatible with newer PHP versions.
  2. Performance: Newer PHP versions often come with performance improvements and optimizations that can make your website run faster.
  3. Security: Each PHP version has its own set of security patches and updates. Running an outdated PHP version may expose your site to security vulnerabilities.
  4. New Features: Newer PHP versions introduce new features and functions that can be beneficial for developers and improve the functionality of your website.

Step-by-Step Guide to Changing the PHP Version in Plesk

  1. Log into Plesk
    • Access your Plesk control panel by entering your Plesk URL into your web browser. This URL typically looks like https://yourdomain.com:8443 or https://yourserverIP:8443.
    • Enter your username and password to log in.
  2. Navigate to the Domain
    • Once logged in, navigate to the “Websites & Domains” tab. Here you will see a list of all the domains and subdomains managed by your Plesk account.
    • Select the domain or subdomain for which you want to change the PHP version.
  3. Access PHP Settings
    • Change the PHP Version Under the selected domain, find and click on the “PHP Settings” option. This will open a new page where you can configure various PHP settings for the selected domain.
  4. Select PHP Version
    • On the PHP Settings page, you will see a drop-down menu labeled “PHP support (run PHP as).” Here you can select the PHP version you want to use for the domain.
    • Click on the drop-down menu and choose the desired PHP version from the list. Plesk usually supports multiple versions of PHP, so you should be able to find the version you need.
    • After selecting the PHP version, make sure to review other PHP settings available on this page, such as memory limit, upload file size, and error reporting, to ensure they meet your application’s requirements.
  5. Apply the Changes
    • Once you have selected the desired PHP version and adjusted other settings, scroll down and click the “OK” or “Apply” button at the bottom of the page.
    • Plesk will apply the new PHP version to the selected domain. This process may take a few seconds for Change the PHP Version.
  6. Verify the Changes
    • After changing the PHP version, it is crucial to verify that your website is working correctly with the new PHP version.
    • You can create a phpinfo() file to check the active PHP version. Create a new file named info.php in your website’s root directory and add the following code:phpCopy code<?php phpinfo(); ?>
    • Access this file by navigating to http://yourdomain.com/info.php in your web browser. The PHP information page will display the current PHP version and other configuration details.
  7. Troubleshooting
    • If you encounter any issues after changing the PHP version, consider checking the following:
      • Error Logs: Plesk provides access to error logs that can help diagnose issues. Navigate to “Logs” under the “Websites & Domains” tab to review any error messages.
      • Compatibility: Ensure that all installed plugins, themes, and scripts are compatible with the selected PHP version.
      • Extensions: Some PHP applications require specific PHP extensions. Make sure these extensions are enabled in the PHP settings page.
  8. Revert if Necessary
    • If the new PHP version causes issues that cannot be resolved quickly, you can revert to the previous PHP version by following the same steps and selecting the original PHP version from the drop-down menu.

Conclusion

Changing the PHP version in Plesk is a straightforward process that can be completed in just a few minutes. By following these steps, you can ensure that your website or application runs on the appropriate PHP version, maximizing performance, security, and compatibility. Always remember to verify the changes and troubleshoot any issues that arise to maintain the smooth operation of your website.

You might also like