How to fix “Invalid header value: must be a string

2019-09-20 13:03发布

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条回答
爷、活的狠高调
2楼-- · 2019-09-20 13:50

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.

查看更多
登录 后发表回答