How to Change PHP Version Print

  • php version, cpanel, hosting
  • 0

To change the PHP version in your cPanel account, follow these steps:

  1. Log in to your cPanel account. This can usually be done by going to your domain/cpanel in a browser.

  2. Once you're logged in, search for the "Software" or "Software/Services" section. The exact name and location may vary depending on your cPanel theme or version.

  3. Look for an icon or link labeled "Select PHP Version" or "PHP Configuration." Click on it to proceed.

  4. On the PHP Selector page, you should see a list of available PHP versions. Choose the desired PHP version from the list. 

  5. After selecting the PHP version, click the "Set as Current" or "Apply" button to save the changes.

  6. Once the changes are saved, cPanel will generate a new .htaccess file to apply the PHP version settings. This file is automatically updated to reflect the selected PHP version.

  7. Optionally, you can verify the PHP version change by visiting your website or running a PHP script. You can create a simple PHP file with the following code:

<?php
phpinfo();
?>

Save the file with a .php extension (e.g., info.php) and upload it to your public_html folder. Access the file through your web browser (e.g., http://yourdomain.com/info.php) ↗) and check the PHP version displayed.

That's it! The PHP version for your cPanel account should now be changed. Remember to remove the info.php file from your hosting account once you've completed the verification.


Was this answer helpful?

« Back