your cron task should be owned by the same user as the web server
Did you specify -u username when creating, or is it running under your user account?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone,
I’m running into a “connection refused” error in my Laravel application when executing cron jobs. Here’s what I’ve checked and tried so far:
Verified that the database credentials in .env are correct.
Increased the database connection limit from 15,000 to 25,000 on the DB server.
The error still persists during cron execution, but the app works fine when accessed via the browser.
Has anyone experienced this issue with Laravel cron jobs before? Could it be related to how the cron environment loads .env or something else I might be missing?
Here’s a snippet of my cron command for reference:
Any suggestions or troubleshooting steps would be really appreciated!
Thanks in advance.
Please or to participate in this conversation.