cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal error: Uncaught Error: Class 'Zend_Controller_Request_Http' not found

Fatal error: Uncaught Error: Class 'Zend_Controller_Request_Http' not found

Fatal error: Uncaught Error: Class 'Zend_Controller_Request_Http' not found
Hi guys, am an admin and not a Magento programming guy. Have a website that was running well on Debian 11. Upgraded to Debian 12 and now am facing this error;

Fatal error: Uncaught Error: Class 'Zend_Controller_Request_Http' not found in /storage/websites/agricomnew/app/code/local/Amasty/Fpc/Model/Fpc/Front.php:103 Stack trace: #0 /storage/websites/agricomnew/app/code/core/Mage/Core/Model/Cache.php(703): Amasty_Fpc_Model_Fpc_Front->__construct() #1 /storage/websites/agricomnew/app/code/core/Mage/Core/Model/Cache.php(685): Mage_Core_Model_Cache->_getProcessor('Amasty_Fpc_Mode...') #2 /storage/websites/agricomnew/app/code/core/Mage/Core/Model/App.php(351): Mage_Core_Model_Cache->processRequest() #3 /storage/websites/agricomnew/app/Mage.php(686): Mage_Core_Model_App->run(Array) #4 /storage/websites/agricomnew/index.php(86): Mage::run('', 'store') #5 {main} thrown in /storage/websites/agricomnew/app/code/local/Amasty/Fpc/Model/Fpc/Front.php on line 103

Have no clue on where to check and seeking some advice.

Thanks!

2 REPLIES 2

Re: Fatal error: Uncaught Error: Class 'Zend_Controller_Request_Http' not found

You have some sort of Amasty full page cache module installed that is throwing that error.

Founder at https://agency418.com

Re: Fatal error: Uncaught Error: Class 'Zend_Controller_Request_Http' not found

Hello @fabrizioma65d5,

The Zend Framework, which is now outdated and not supported in newer PHP versions. As you've upgraded to Debian 12, it's possible you're now using a PHP version that no longer supports Zend, causing the error: Class 'Zend_Controller_Request_Http' not found.

The Laminas equivalent of Zend_Controller_Request_Http is Laminas\Http\Request. This is part of the Laminas framework, which is the successor to the Zend Framework. Here's how you can map Zend components to Laminas:

 

Replacement Overview

  • Zend Framework: Zend_Controller_Request_Http
  • Laminas Framework: Laminas\Http\Request

Code Replacement Example

If you're migrating code from Zend to Laminas, you'll need to replace instances of Zend_Controller_Request_Http with Laminas\Http\Request.

Here's an example of what the code replacement might look like:

 

Before (Zend):

$request = new Zend_Controller_Request_Http();

$method = $request->getMethod();

 

After (Laminas):

use Laminas\Http\Request;

$request = new Request();

$method = $request->getMethod();

Namespaces and Changes

 

  1. Namespaces: Laminas uses namespaces differently, so you must ensure that you're properly importing the Laminas\Http\Request class at the top of your file with the use statement.
  2. Request Methods: Most of the request methods (getMethod(), getPost(), etc.) will remain the same between Zend and Laminas.

If laminas package is not installed for this you can installed it with:

composer require laminas/laminas-http

After this, your Magento code should work with Laminas in place of Zend for HTTP requests.

 

If the issue will be resolved, Click Kudos & Accept as a Solution.