Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrorException in console (composer update / php artisan command) #30

Open
yuters opened this issue Jan 15, 2021 · 2 comments
Open

ErrorException in console (composer update / php artisan command) #30

yuters opened this issue Jan 15, 2021 · 2 comments

Comments

@yuters
Copy link

yuters commented Jan 15, 2021

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| 	}
@ajmnz
Copy link

ajmnz commented Aug 2, 2021

I solved it this way antonioribeiro/tracker#476 (comment), but definitely not ideal

@yuters
Copy link
Author

yuters commented Aug 2, 2021

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

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

preBit added a commit to preBit/support that referenced this issue Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants