Laravel .env file config

Hi,

I know it’s not ideal to use this type of hosting for a Laravel project but you are perfect for dev purposes.

I’ve got a Laravel project up and running but cant seem to config my .env file so the app can find the database file - I’m using sqlite and the database file is /htdocs/database/database.sqlite

Ive tried every permutation and combination I can think of before contacting you but Im still getting an error when the app tries to access the dbase (homepage etc works fine)

heres my .env:

APP_NAME=PaxMaster
APP_ENV=local
APP_KEY=base64:j3Tv/p/SPqd4dbNlsqQMxhMYRssEnXKpVls+wc/FG34=
APP_DEBUG=true
APP_URL=http://paxmaster.epizy.com

LOG_CHANNEL=stack

DB_CONNECTION=sqlite
DB_HOST=paxmaster.epizy.com
DB_PORT=3306

DB_DATABASE=./databsae/database.sqlite
DB_USERNAME=homestead
DB_PASSWORD=secret

and heres the error
Database (./databsae/database.sqlite) does not exist. (SQL: PRAGMA foreign_keys = ON;)

Pleeeeese! Hope you can help.

Hello! Your database host is not paxmaster.epizy.com, is is in the form of sqlxxx.epizy.com, You can find it in the client area (app.infinityfree.net)

@HaydenANG You are correct if he used MySQL DB. But he is using SQLite DB.

@rubbishkissbox See again your config.
DB_DATABASE=./databsae/database.sqlite
Does ./databsae/ folder (not ./database/) really exist?

1 Like

Wow! That was a seriously quick response! Thanks!

I’m not using mysql tho, I’m using sqlite.

Any ideas what settings I need to use?

Typo, sorry ./database/database.sqlite

Oops didn’t see that :rofl:, And i checked;

SQLite is available on all services though. Our servers have the PDO drivers for SQLite installed, so you can use SQLite from PHP. Since SQLite is just a file which can be placed anywhere, you can create a SQLite database in whatever way you want and then upload the database file to your hosting account using FTP or a file manager.

This shows it is supported, but all i can suggest is double triple checking, it doesn’t exist, and I get 404, maybe it is trying root directory?

So, the path is correct, but still getting error?

Fixed the typo, still giving same error.

Pleese help, I’m going mad!

The root of the path must be wrong I think. It works on my localhost

I have noticed, that /database, goes to /public/database, could that be it?

You’re an effin’ star HaydenANG

:slight_smile:

How did you trace that?

IDK, Just searched it

:hugs:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.