How to fix “Invalid header value: must be a string or array of strings” in Laravel

两盒软妹~` 提交于 2019-12-25 18:32:48

问题


I have an issue on a prod server that I don't have in local. Laravel send me an error which says that there is a header issue. I think this is an Apache issue.

I work on my local machine with Mamp. Laravel is using OAuth with Laravel Passport. I've tried on my local machine and it's working. I'm running on a Apache server too.

On my production server, as soon as I want to login on my application, I have this error :

ERROR 500 : InvalidArgumentException, Invalid header value: must be a string or array of strings; cannot be an empty array.

And it's in MessageTrait.php line 389 from Laravel Zendframwork vendor.

Maybe it's just a module on the server ?

Thanks


回答1:


I was having the same problem, my solution was to downgrade the next packages to that specific version because that was the version that was working in my project:

composer require symfony/http-kernel:3.4.20
composer require symfony/http-foundation:3.4.20
composer require symfony/psr-http-message-bridge:1.1.0

I hope it works for you.



来源:https://stackoverflow.com/questions/55419216/how-to-fix-invalid-header-value-must-be-a-string-or-array-of-strings-in-larav

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!