support icon indicating copy to clipboard operation
support copied to clipboard

ErrorException in console (composer update / php artisan command)

Open yuters opened this issue 4 years ago • 2 comments

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| 	}

yuters avatar Jan 15 '21 15:01 yuters

I solved it this way https://github.com/antonioribeiro/tracker/issues/476#issuecomment-550393843, but definitely not ideal

ajmnz avatar Aug 02 '21 13:08 ajmnz

Since it's specifically used with Laravel I've found it better to just add this to line 21 :

if ( ! app()->runningInConsole() && ! $this->isStarted())

yuters avatar Aug 02 '21 15:08 yuters