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

lati111's avatar

Entire application unusable due to connection error

I am entirely unsure as to what is causing this issue, but when opening my application on any server (I've tried artisan serve and xampp both, on several devices as well so I doubt it's an environment issue) I get a ERR_CONNECTION_RESET error when I attempt to open any page, followed by a connection refused every time I try afterwards. Both laravel and apache logs don't are empty as well. I've tried putting a number of dd's at various points (mostly controller of the page used, and middleware for that route), but none of those statements ever seem to trigger so it likely crashes before then. I'm honestly stumped on how to attempt to fix this, as I don't have a single lead as to where I should begin to investigate it. Any help would be much appreciated.

I'm using the following composer dependencies:

   -  "php": "^8.1",
    -  "amenadiel/jpgraph": "^4.1", (v4.1.1)
   -   "dompdf/dompdf": "^2.0", (v2.0)
   -   "dyrynda/laravel-cascade-soft-deletes": "*", (4.3.0)
    -  "guzzlehttp/guzzle": "^7.2", (7.8.2)
   -   "laravel/framework": "^10.0", (v10.38.2)
   -   "laravel/sanctum": "^3.2", (v3.3.2)
    -  "laravel/tinker": "^2.7", (v2.8.2)
   -   "phpoffice/phpword": "^1.1" (1.1.0)

    -  "fakerphp/faker": "^1.9.1", (1.23.0)
    -  "laravel/pint": "^1.0", (v1.13.7)
    -  "laravel/sail": "^1.0.1", (1.6.7)
    -  "mockery/mockery": "^1.4.4", (1.6.7)
    -  "nunomaduro/collision": "^6.1", (v6.4.0)
    -  "phpunit/phpunit": "^9.5.10", (9.6.15)
    -  "spatie/laravel-ignition": "^2.0" (2.3.3)

and these npm dependencies:

    -  "autoprefixer": "^10.4.13",
    -  "axios": "^1.1.2",
    -  "lodash": "^4.17.19",
    -  "postcss": "^8.4.21",
    -  "typescript": "^5.3.2",
   -   "laravel-vite-plugin": "^1.0.0",
    -  "vite": "^5.0.0"

    -  "metro4": "^4.5.6",
    -  "tailwindcss": "^3.3.6"
0 likes
9 replies
Robstar's avatar

ERR_CONNECTION_RESET indicates the browser can't make a connection to the server your application is hosted upon, meaning the error is happening at a higher level.

Does you have you .htaccess files setup files correctly, as if hosting on shared hosting you need to adjust them. This is the definitely the issue if you https://site.co.uk/public/index.php loads.

lati111's avatar

@Robstar I think the .htaccess file is fine, I haven't made any changes to it and it used to work before. Putting an echo in the index.php followed by a die at the top of the file also seems to work, as I get my echoed statement. So the issue occurs either after the index, or later in the index.

lati111's avatar

@Robstar The application is currently being hosted locally for development with xampp or artisan serve. I've looking into seeing if I get anything from the network tab, but it's trying to connect to the localhost the application is hosted on but the status says it failed due to (failed)net::ERR_CONNECTION_REFUSED. If I put the die statement in the public/index.php however it returns just fine (with a 200 status)

Bogey's avatar

What was going on when the errors started? What were you working on when the app broke? Does the database get connected successfully? Is your APP_URL in .env set correctly? Maybe middlewares or serviceproviders mess with things.

lati111's avatar

@Bogey The last thing I did was run composer update and npm update (as I was having some issues with getting vite build to work due to an outdated vite version), upon which everything broke down. Even after rerolling the changes it has remained broken. I haven't made any changes to the env, middleware or serviceproviders that haven't been rollbacked either, so I doubt thats it.

Bogey's avatar

npm cache clean --force does clearing npm cache help? Are you using npm run dev or just php artisan serve? Try composer dump-autoload to reset your autoloader. Maybe update your composer and npm packages again, clear npm cache, dump composer autoloader, clear laravel cache (php artisan optimize:clear), clear browser cache

Robstar's avatar

Does the site load a private tab or different web browser?

Please or to participate in this conversation.