How to Fix “Whoops, it looks like you have an invalid PHP version” in Magento

Today one of my friends call me and ask about a Magento issues which are occurring on his client site. The error is “Whoops, it looks like you have an invalid PHP version. Magento supports PHP 5.3.0 or newer. Find out how to install Magento using PHP-CGI as a workaround.”. I have done some R&D to fix this issues and finally got the issue. It seems he have installed PHP 5.3 version on his client server.

magento php version error

Open the Object.php lib/Varien/Object.php and go to line number 484 and replace the below code by new code.

replace by

Open the Price.php file app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php and go to the line number 139:

replace by

After that open this file lib/Zend/Pdf/Resource/Image/Jpeg.php and go to the line number 59 and replace the below code.

replace by

Now open the below files:

find the error_reporting(E_ALL | E_STRICT); and replace by error_reporting(E_ALL & E_STRICT & ~E_DEPRECATED);

After done the above changes login in your site by using the FTP client, clear the cache and then you will be able to use Magento with PHP 5.3 version.

System Requirements for Magento Enterprise Edition and Community Edition

Below are the system requirements for the Magento sites.

Magento requires a LAMP or LNMP stack

Web Server

  • Apache 2.x
  • Nginx 1.7.x
  • Database
  • MySQL 5.6 (Oracle or Percona)

PHP Version

Magento CE 1.9.2 and later, Magento EE 1.14.2 and later:

  • PHP 5.6.x
  • PHP 5.4.x
  • PHP 5.5.x

Earlier Magento versions:

  • PHP 5.4.x
  • PHP 5.5.x

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , ,