cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4.3 is requiring PHP 8.1 on storefront

SOLVED

Magento 2.4.3 is requiring PHP 8.1 on storefront

I'm currently setting up a Magento 2.4.3 community edition project locally. I'm already running the PHP 7.4 version as per system requirements. However, after running the compile commands successfully, the storefront is asking for PHP 8.1. 

 

Can you please suggest any items that I need to check? 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.4.3 is requiring PHP 8.1 on storefront

It seems your Magento storefront is detecting the PHP version incorrectly and assuming PHP 8.1 is required rather than the actual minimum of PHP 7.4 that 2.4.3 supports.

A few things to check on your local environment:

  • Confirm your actual PHP version by running `php -v` on the command line. Ensure you are using PHP 7.4+
  • Check if you have multiple PHP versions installed and if an incorrect php binary is first in path
  • Look for any custom code or PHP overrides that may be forcing the PHP version requirement check
  • Try with a fresh Magento 2.4.3 install without customizations as a baseline

Typically this PHP version detection issue is due to an environment misconfiguration rather than a problem with core Magento 2.4.3 itself.

Get your local env confirmed to be running PHP 7.4/7.3 first. Also trace through config files and custom code to spot anywhere PHP 8.1 could be explicitly getting checked/required incorrectly.

View solution in original post

2 REPLIES 2

Re: Magento 2.4.3 is requiring PHP 8.1 on storefront

It seems your Magento storefront is detecting the PHP version incorrectly and assuming PHP 8.1 is required rather than the actual minimum of PHP 7.4 that 2.4.3 supports.

A few things to check on your local environment:

  • Confirm your actual PHP version by running `php -v` on the command line. Ensure you are using PHP 7.4+
  • Check if you have multiple PHP versions installed and if an incorrect php binary is first in path
  • Look for any custom code or PHP overrides that may be forcing the PHP version requirement check
  • Try with a fresh Magento 2.4.3 install without customizations as a baseline

Typically this PHP version detection issue is due to an environment misconfiguration rather than a problem with core Magento 2.4.3 itself.

Get your local env confirmed to be running PHP 7.4/7.3 first. Also trace through config files and custom code to spot anywhere PHP 8.1 could be explicitly getting checked/required incorrectly.

Re: Magento 2.4.3 is requiring PHP 8.1 on storefront

Thank you for your help.

 

The version in the PHP binary path is wrong and it was probably due to multiple switching that I've been doing. After correcting it, my local environment is now working.