support
support copied to clipboard
ErrorException in console (composer update / php artisan command)
Laravel Framework: 6.20.11 PHP Version: 7.4.14 Package version: Support v0.9.3 Used as a depencency for: Tracker v4.0.1
$ composer update
...
ErrorException : session_start(): Cannot start session when headers already sent
at /vendor/pragmarx/support/src/PhpSession.php:23
19| private function startSession()
20| {
21| if ( ! $this->isStarted())
22| {
> 23| session_start();
24| }
25| }
I solved it this way https://github.com/antonioribeiro/tracker/issues/476#issuecomment-550393843, but definitely not ideal
Since it's specifically used with Laravel I've found it better to just add this to line 21 :
if ( ! app()->runningInConsole() && ! $this->isStarted())