PHP and SQLite error

Hello !
I’m running a PHP project (no node, no docker) and get the same error.
What should I do, as I don’t find any “app” folder nor “db” one ?
Is PHP + SQLite a supported environment ?
Thank you !

What error exactly did you got and what was the path selected for the SQLite file in the database manager and in the server connect connection?

It got me crazy all morning but I’ve finally figured it out.

Config : Windows 10, latest Wappler (V4.2.2), PHP and SQLite
What I’m sharing above is for a SQLite DB created at the root of your project.

In the DB manager, DON’T USE THE “OPEN EXISTING” dialog to redefine your config.
It will configure the full path like “/your_db.sqlite3” where it should only be “your_db” without any extension or slash.

Correct local path for my learnybox.sqlite3 database file at the root of the project :

Now the kicker is that in server connect, under globals, when you setup your DB connection settings…
You have to type in your database path, there is no dialog to select it, so I had to figure it out for myself.
And copy/pasting the same path as the local one doesn’t work.

If you put just “your_db” name, it will create a new empty db remotely named “your_db” without any file extension later down the road when you try to connect to it for a query.
You have to input the db filename with it’s extension “your_db.sqlite3” but NO SLASH.

Correct remote path for my learnybox.sqlite3 database file at the root of the project :

Hopefully this post will save someone’s hair and will enable the team to improve the SQLite setup flow. I find it confusing that you have to configure it at two different locations with a different set of parameters to be able to work with the same “DB” locally and remotely.

Have a great week-end ! :slight_smile:

EDIT : You might want to quit completely wappler after your modified your config. Re-open wappler and check both DB settings (local/remote) you just changed “sticked”. Then delete your whole remote install and re-upload from scratch.

Hmm normally the same paths should work exactly the same with the root slash and default .sqlite3 extension.

But @patrick will check the php implementation maybe there is an anomaly there

Thank you @George

I’ve improved how the paths are handled within PHP, it did indeed have problems with the starting slash and because of that it was pointing to an incorrect path and placing the database file in the root of the drive. This is now fixed. The file extension seems to be optional, but it works when you add it with both direct connection and in server connect.

Connection.zip (1.9 KB) Unzip in dmxConnectLib/lib/db.
dmxDatabase.zip (2.9 KB) Unzip in dmxConnections.

1 Like

Thank you Patrick !

This has been fixed in Wappler 4.3.0

Awesome. Thank you guys :slight_smile:

This topic was automatically closed after 43 hours. New replies are no longer allowed.