Search code examples
phplaraveloctobercms

Error "A database is required to access the back-end" when deploying to a remote server


On my local machine, I've developed a project with OCTOBER CMS. All good, I can go to backend cms and so on. When I'm deploying on a hosting server, everything is ok, except the backend cms. It keeps showing this to me:

A database is required to access the back-end. Check the database is configured and migrated before trying again.

My .env file in that server has the changes of the database from the hosting server.

I've also tried to modify the config/database.php with the new credentials but without success.


Solution

  • these are few possible solutions to this:

    • make sure the configuration is correct in file config/database.php
    • make sure the database is created
    • change localhost to 127.0.0.1 if it didn't work
    • clear the cache by running the command php artisan config:clear