Showing results for 
Search instead for 
Did you mean: 

[Zend_Http_Exception] Invalid header line detected

[Zend_Http_Exception] Invalid header line detected



We're facing an issue in SSH whenever we try to run command lines like:




The system does not fully recompile. Though on front end seems to not show issues.


This error has happened suddenly, and we have not upgraded or made any changes to our site.


ANy ideas where to start looking? We've checked our logs and nothing seems to show up.


Re: [Zend_Http_Exception] Invalid header line detected

Can anyone help ?

Re: [Zend_Http_Exception] Invalid header line detected

Hello @TIMMY9,


Can you please run below command in Magento root directory and give me a screenshot of errors

php bin/magento setup:di:compile

If my answer is useful, please Accept as Solution & give Kudos

Re: [Zend_Http_Exception] Invalid header line detected

Hello I can't send a picture  but here after running your command:


Compilation was started.
Proxies code generation... 0/7 [>---------------------------] 0% < 1 sec 50.0 Proxies code generation... 1/7 [====>-----------------------] 14% < 1 sec 54.0 Repositories code generation... 1/7 [====>-----------------------] 14% < 1 sec Repositories code generation... 2/7 [========>-------------------] 28% 4 secs 1 Service data attributes generation... 2/7 [========>-------------------] 28% 4 Service data attributes generation... 3/7 [============>---------------] 42% 4 Application code generator... 3/7 [============>---------------] 42% 4 secs 182 Application code generator... 4/7 [================>-----------] 57% 8 secs 212 Interceptors generation... 4/7 [================>-----------] 57% 8 secs 212.0 Interception cache generation... 7/7 [============================] 100% 20 secs 346.0 MiB
Generated code and dependency injection configuration successfully.



Re: [Zend_Http_Exception] Invalid header line detected

This Zend_Http_Exception is believed to have since been resolved by changing php version from 7.1 to 7.0.

Re: [Zend_Http_Exception] Invalid header line detected

ea-php-cli Copyright 2017 cPanel, Inc.
PHP 7.0.32 (cli) (built: Nov 13 2018 20:08:47) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

Re: [Zend_Http_Exception] Invalid header line detected

It seems this issue is still not resolved upon further checking, as certain commands when run on SSH are not running properly.


Can anyone advise? This has occurred without any major upgrades or changes to the site and very peculiar.

Re: [Zend_Http_Exception] Invalid header line detected

Hello, I just wonder if you have installed the litemage extension? I got the same problem when I installed the litemage extension and tried to flush the cache in SSH. It was a bug in the extension. I then upgraded to the latest version when they fixed the bug and it is fine. BUT I got the same problem when I tried to integrate with a stock management system linnworks. I'm not sure what is causing the problem now.

Re: [Zend_Http_Exception] Invalid header line detected



( think you're the same user flyingmomo in stackexchange.. I am Tucker.)

We are using litemage cache from the July 2018 version, also we're using linnworks. But as is being described it has come out no where.


My team of two developers have spent a lot of time going through it. In the end they switched php version and disabled litemage.


Can you share what occurred in linnworks exactly?

Re: [Zend_Http_Exception] Invalid header line detected

@Tucker Sorry for late reply. I still could not integrate with Linnworks. We use the API integration instructed by Linnworks for Magento 2 but we have had an error message on the integration page when we click activate: Unable to post data to consumer due to an unexpected error. But if you check the exception.log you will see this: Main.CRITICAL: Invalid header line detected {"exception":"[object] (Zend_Http_Exception(code: 0): Invalid header line detected at ../public_html/vendor/magento/zendframework1/library/Zend/Http/Response.php:371)"} []. Please let me know if you have found any solution for that.