Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

RavanScafi's avatar

Why console commands uses sessions?

I'm using L5 for quite a long time, but my version was locked in the pre-package changes. So I updated my packages and now I've finally updated L5 version to the latest changes.

But I notice that now I can't run console commands from outside homestead. Not even a single php artisan. And this is due to the fact that my session driver is set to database. So, I need to be inside homestead to run everything, even a composer update that triggers artisan post-update commands (which is extremely slow with the vm's low memory)

I changed the driver to file and it runs with no problems, which leads to my question: Why console commands uses sessions? Is it a change in L5 or I did something wrong? (like with middlewares, I don't know)

0 likes
2 replies
RavanScafi's avatar

@sachinagarwal yes, this is not the problem, the error is about trying to connect to localhost:3306 outside of homestead (should be the forwarded one: 33060), but I can solve it by having two different envs for inside and outside homestead.

my concern is about using sessions for running artisan, I don't get the point of doing it.

Please or to participate in this conversation.