Skip to content

Laravel 11: DB_URL instead of DATABASE_URL #45

@chimobi-justice

Description

@chimobi-justice

### Description:

When deploying a Laravel 11 application on (render.com), I encountered an issue with the database connection. The DATABASE_URL environment variable, which was previously used in earlier Laravel versions, has been replaced with DB_URL in Laravel 11.

To resolve this, update your (render.com) environment variables to use DB_URL instead of DATABASE_URL. This change will allow your Laravel 11 application to connect to the database successfully.

### Steps to reproduce:

  1. Deploy a Laravel 11 application on (render.com)
  2. Set the DATABASE_URL environment variable
  3. Run database migrations or try to access the database

### Expected behavior:

The application should connect to the database using the DB_URL environment variable.

### Actual behavior:

The application fails to connect to the database, throwing a Connection refused error.

### Solution:

Update the environment variable to DB_URL and redeploy your application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions