Hackernoon logoHow to Change PHP Versions in Magento by@ashishm

How to Change PHP Versions in Magento

Author profile picture

@ashishmAshish

I am a writer and i love to write about Magento, E-commerce, Wordpress, and all tech related topics.

Magento permits a unique server setup that enables each customer to choose which version of PHP to utilize or switch PHP versions in Magento.
Magento 2 supports those Php versions for today: PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2 & PHP 7.3 (such as Magento 2.3.3).
image credit: meetanshi.com
To change the PHP version on your hosting accounts, follow the steps below:
  1. Log into cPanel to your Accounts
  2. Navigate to 1H Program Segment -> PHP Version Manager
  3. Visit the directory You Want to change the PHP version for (Please Be Aware this change applies to subdirectories to This Too )
  4. Click on the directory
  5. Title Pick the desired PHP Variant
  6. Click for save
Make the most from This Managed PHP Variant Services. Update your PHP version to the most recent when available, and protected one.
To execute it, Choose the Managed PHP Version choice and Conserve . It'll add the handler on your .htaccess document
AddHandler application/x-httpd-recommended-php .php .php5 .php4 .php3
It makes certain your shop is running on the PHP version that is advised in the side with no implementations.
Another option is to apply the changes manually by incorporating one of the under directives from the .htaccess record of your shop:
Switch to PHP 7.3
AddHandler application/x-httpd-php73 .php .php5 .php4 .php3

Switch to PHP 7.2
AddHandler application/x-httpd-php72 .php .php5 .php4 .php3
Switch to PHP 7.1
AddHandler application/x-httpd-php71 .php .php5 .php4 .php3
Doing this will alter the PHP model for this website and all its subfolders.
If you'd like a different version of PHP in a subdirectory, then make a new .htaccess document inside together with the directive to your desirable PHP version.


Tags

The Noonification banner

Subscribe to get your daily round-up of top tech stories!