I have just upgraded my Magento version from 2.4.0 to 2.4.6 and it is giving this error while opening admin. please suggest any solution
1 exception(s):
Exception #0 (Exception): User Deprecated Functionality: Class is deprecated in /home/websites/hollywp/dev.domain/public_html/vendor/magento/framework/HTTP/ZendClient.php on line 27
-
What steps did you take to upgrade?Ahmad– Ahmad2023年10月25日 10:48:36 +00:00Commented Oct 25, 2023 at 10:48
-
Updated it through composer update command and fixed deprecated errors but now stuck in this oneTisha Jhanwar– Tisha Jhanwar2023年10月25日 10:54:07 +00:00Commented Oct 25, 2023 at 10:54
-
magento.stackexchange.com/a/365716/50161Savan Patel– Savan Patel2023年10月25日 10:59:19 +00:00Commented Oct 25, 2023 at 10:59
2 Answers 2
For the solution, we can use LaminasClient class. Laminas\Http\Client class has the following method which replaces ZendClient class methods.
You can refer to more methods for LaminasClient class located at vendor/laminas/laminas-http/src/Client.php
You can refer this link for more infomation. https://www.mage2developer.com/zendclient-class-is-deprecated-in-magento-version-2-4-6/
THANKS.
-
where to modify this code?Tisha Jhanwar– Tisha Jhanwar2023年10月25日 11:05:57 +00:00Commented Oct 25, 2023 at 11:05
-
Header add like Array setHeaders([]) ` $client->setHeaders(['Authorization: Bearer ' . $this->apiKey]); `Alex– Alex2025年02月26日 12:31:04 +00:00Commented Feb 26 at 12:31
You can resolve this (for the time being) by adding magento/zendframework1 back into your build.
composer require magento/zendframework1
Install zendframwork in your magento and it will work
-
I have to find a permanent solution for this!Tisha Jhanwar– Tisha Jhanwar2023年10月25日 11:50:13 +00:00Commented Oct 25, 2023 at 11:50
-
@TishaJhanwar please add the solution here so that someone get help from thatArun Kumar– Arun Kumar2024年02月21日 12:12:39 +00:00Commented Feb 21, 2024 at 12:12
-
I'm getting str null character errors related to zend. I installed 2.4.6 from scratch, then updated to 2.4.7-p2 during development and am having one heck of a time getting checkout to work and am really confused as to how to properly upgrade and get rid of zend.Steven Lutz– Steven Lutz2024年09月19日 09:27:37 +00:00Commented Sep 19, 2024 at 9:27
-
@StevenLutz What is the actual error you are getting?Arun Kumar– Arun Kumar2024年09月24日 04:32:51 +00:00Commented Sep 24, 2024 at 4:32
-
Similar to the one above. Posted here magento.stackexchange.com/questions/375055/…Steven Lutz– Steven Lutz2024年09月25日 20:50:53 +00:00Commented Sep 25, 2024 at 20:50
Explore related questions
See similar questions with these tags.