2

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
Mohit Patel
4,0484 gold badges27 silver badges57 bronze badges
asked Oct 25, 2023 at 10:39
3
  • What steps did you take to upgrade? Commented Oct 25, 2023 at 10:48
  • Updated it through composer update command and fixed deprecated errors but now stuck in this one Commented Oct 25, 2023 at 10:54
  • magento.stackexchange.com/a/365716/50161 Commented Oct 25, 2023 at 10:59

2 Answers 2

4

For the solution, we can use LaminasClient class. Laminas\Http\Client class has the following method which replaces ZendClient class methods.

enter image description here

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.

answered Oct 25, 2023 at 10:48
2
  • where to modify this code? Commented Oct 25, 2023 at 11:05
  • Header add like Array setHeaders([]) ` $client->setHeaders(['Authorization: Bearer ' . $this->apiKey]); ` Commented Feb 26 at 12:31
0

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

Reference link

answered Oct 25, 2023 at 11:16
6
  • I have to find a permanent solution for this! Commented Oct 25, 2023 at 11:50
  • @TishaJhanwar please add the solution here so that someone get help from that Commented 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. Commented Sep 19, 2024 at 9:27
  • @StevenLutz What is the actual error you are getting? Commented Sep 24, 2024 at 4:32
  • Similar to the one above. Posted here magento.stackexchange.com/questions/375055/… Commented Sep 25, 2024 at 20:50

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.