{"id":2750,"date":"2024-12-31T20:26:17","date_gmt":"2024-12-31T20:26:17","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/solved-class-zend-not-found-in-magento-2-fix-all-zend-errors\/"},"modified":"2025-04-09T11:08:42","modified_gmt":"2025-04-09T05:38:42","slug":"solved-class-zend-not-found-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solved-class-zend-not-found-in-magento-2\/","title":{"rendered":"Solved: Class Zend Not Found in Magento 2 \u2013 Fix All Zend Errors"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Facing issues related to Zend Class not found in Magento 2 after an upgrade?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019re not alone. A lot of other people have reported the same issue after the Magento 2.4.6 upgrade.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s because Magento has deprecated the Zend Framework from its codebase.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On April 8, 2024, Adobe rolled out the\u00a0<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-4-8\/\">Magento 2.4.8<\/a>\u00a0release with over 140+ quality fixes and platform enhancements. One of the major backward-incompatible changes introduced in the release was the deprecation of the Zend framework from the codebase.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Zend classes in the Magento 2 core code have been replaced with the Laminas.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, they may still be present in the third-party modules and throw errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Some of the common errors include:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>Error: Class Zend_Json not found<\/em><\/li>\n\n\n\n<li><em>Error: Class Zend_Http_Client not found<\/em><\/li>\n\n\n\n<li><em>Error: Class Zend_Filter not found<\/em><\/li>\n\n\n\n<li><em>Error: Class Zend_Validate not found<\/em><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the solution provided below for any&nbsp;Class Zend not found in Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s how to solve this.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Solve \u2018Error Class Zend not found\u2019 in Magento 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to solve the&nbsp;<em><strong>Class Zend not found<\/strong><\/em>&nbsp;exception in Magento 2, you need to replace the Zend classes with the Laminas.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Follow these steps:<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install Laminas<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First of all, you need to install the&nbsp;<code>laminas\/laminas-serializer<\/code>&nbsp;in Magento 2. You can install it by using the following command in the terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>composer require laminas\/laminas-serializer<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Replace Zend Classes with Laminas<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once the&nbsp;<em><strong>Laminas<\/strong><\/em>&nbsp;is installed, you need to replace the Zend classes with it.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the&nbsp;<code>.phtml<\/code>&nbsp;file where you are facing the&nbsp;<em><strong>main.CRITICAL: Error: Class Zend not found in Magento 2<\/strong><\/em>.<\/li>\n\n\n\n<li>Find and replace the respective Zend classes with that of Laminas as provided in the table below:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Zend Class<\/strong><\/th><th><strong>Laminas Class<\/strong><\/th><\/tr><\/thead><tbody><tr><td>\\Zend_Http_Client::POST<\/td><td>\\Laminas\\Http\\Request::METHOD_POST<\/td><\/tr><tr><td>\\Zend_Http_Client::GET<\/td><td>\\Laminas\\Http\\Request::METHOD_GET<\/td><\/tr><tr><td>\\Zend_Json<\/td><td>\\Laminas\\Json\\Json<\/td><\/tr><tr><td>\\Zend_Filter<\/td><td>laminas-filter<\/td><\/tr><tr><td>\\Zend_HTTP<\/td><td>laminas-http<\/td><\/tr><tr><td>\\Zend_Validate<\/td><td>laminas-validator<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Save the file.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">And for the&nbsp;<code>\\Zend_Filter_Input<\/code>, you can use the following code snippet as its equivalent:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$inputFilter = new \\Magento\\Framework\\Filter\\FilterInput(\n        ['date_from' => $this->dateFilter, 'date_to' => $this->dateFilter],\n        [],\n        $data\n    );<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the find-and-replace functionality of the code editors to do this.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Repeat the above steps to replace the Zend classes for all the third-party modules to prevent the error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The official Zend Framework has rebranded as the&nbsp;<a href=\"https:\/\/www.zend.com\/resources\/what-laminas\" target=\"_blank\" rel=\"noreferrer noopener\">Laminas Project<\/a>&nbsp;over to the Linux foundation. Therefore, Adobe has also replaced the Zend Framework with Laminas in the core code of Magento and Adobe Commerce. The third-party module needs to be upgraded to the Laminas as well to prevent the main.CRITICAL: Error: Class Zend not found exception in Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I hope the above-provided steps will help you solve the&nbsp;<em><strong>Class Zend not found error in Magento 2<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In case, you are still facing the issue, feel free to comment. I would be happy to help you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Problem solved? Spread the knowledge. Share this solution with your friends via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You!  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Facing issues related to Zend Class not found in Magento 2 after an upgrade? You\u2019re not alone. A lot of other people have reported the same issue after the Magento 2.4.6 upgrade. That\u2019s because Magento has deprecated the Zend Framework from its codebase. On April 8, 2024, Adobe rolled out the\u00a0Magento 2.4.8\u00a0release with over 140+ [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-2750","post","type-post","status-publish","format-standard","hentry","category-magento"],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2750","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=2750"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2750\/revisions"}],"predecessor-version":[{"id":11559,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/2750\/revisions\/11559"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=2750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=2750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=2750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}