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

WhiskeyMike's avatar

Cannot Deploy to Laravel Vapor

Hello.

Kind of a noob here, but I've been facing a problem that I've spent the last 30 days trying to combat, and I'm at my wits end. I'm about to scrap the project and face defeat. Before I do, after hours of Google searching, reading and posting on StackOverflow, and no less than 200 browser windows left open for reference, I figured I'd post here.

I developed an app/website for a friend. We want to go through Vapor due to the ease of use (in past experiences). When I attempted to deploy the staging to vapor, I encountered an error that my app is too large (which I find incredible since it's not really that large... but I digress). I later found that I can deploy larger apps to Vapor using Docker and Laravel Sail. After some Google searching and some documentation, I discovered there's a thing called Ubuntu, and it's basically Linux in a Windows app. So I go through the installation steps for WSL2, Ubuntu, Docker, etc. I install Sail, and I thought "Ah ha!!!!! I'll now be able to deploy my 'large' (according to Vapor) app!!!!!!". Except, when I run "sail build --no-cache", then "sail up -d", I get the error: "SQLSTATE[HY000] [2002] Connection refused".

I have tried everything. If there's an article out on the interwebs addressing this issue, I've tried it. I've tinkered with the .env file, I've used different ports, I've changed usernames, database names, almost changed my own name. I cannot get the database to accept the connection in the browser. Oddly enough, it has no problem connecting, migrating, and seeding though. So, that's pretty bad right? 30 days of attempting to solve this problem through posts, questions, and even through hiring a freelancer... and nothing has worked. But it dawned on me... since I know the app works fine (when I previously developed on Wamp prior to finding out my app needed to deploy with Docker)... (and no, Wamp wasn't running while using Docker)... maybe I can just deploy straight to Vapor without worrying about my local environment SQL not connecting.

So I attempted that. "vapor deploy test". What did I get? Not success. No, I got about 7 npm warnings about deprecated packages, and a big red error that "''rm' is not recognized as an internal or external command". Back to Google... back to installing other packages (Swift?), each to combat the previous error, each presenting their own new errors.

Am I just doomed to have to drop this project? Does anyone have any suggestions?

0 likes
0 replies

Please or to participate in this conversation.