I have created a ‘debug_kit’ connection in my app_local.php, Datasources.
I do have a working MySQL for my application as such as the default datasource - and it’s working fine.
My expectation would be, DebugKit loads and uses the provided DebugKit connection / database.
Actually i’m now getting an error, which looks as if DebugKit is not using the connection, but still tries to use sqlite:
# Database driver Cake\Database\Driver\Sqlite cannot be used due to a missing PHP extension or unmet dependency
Am i missing something? Do i have to somehow disable Sqlite usage for DebugKit / force database/mysql usage?
As the error says you are missing the SQLite PHP extension.
You need to search for how to install SQLite PHP extension for your setup / operating system.
Hi Kevin, thanks for the reply. Maybe i did not make myself clear, sorry for that, trying again:
I do NOT want to use sqlite - and the cookbook documentation says on that matter:
By default DebugKit will store panel data into a SQLite database in your application’s tmp directory. If you cannot install pdo_sqlite, you can configure DebugKit to use a different database by defining a debug_kit connection in the Datasources variable in your config/app.php file.
So I am assuming, i can just define the data source and then DebugKit will automatically not use SQLite but my MySQL DB instead.
As described in the beginning, i have defined that connection. However, i’m still seeing DebugKit to trying to go for SQLite. What am i missing?
@ADmad what do you say about that? I guess the doc is missleading because the debug kit still requires the sqlite extension even if a non sqlite connection is set in the apps config.
@stefan.hegenbart are you sure you didn’t specify 'driver' => 'Cake\Database\Driver\Sqlite', as the driver in your custom debug_kit datasource (or any other datatsource)?
Ok, thanks for looking into it. Let me try to find out what’s going on.
With regards to plugins I’m only using vanilla cakephp + auth plugin + debugkit I have not yet added something else. The application works well - until i’m activating debugkit.
Just to be sure: I need to add the debug kit connection in app_local - same place where I’m also adding my other data connections for my application?
Yes, its fine to add it to your config/app_local.php since it is merged with the “normal” config here:
You can also apply those changes manually in your vendor/cakephp/cakephp folder to get a more telling error.
The next CakePHP release will contain the connection name which requires the missing PHP extension and therefore debugging your problem will be easier.
“test” connection indeed is sqlite - but to my knowledge, no module of my app is using the connection. I’m not employing the test suite.
this only happens, when i activate debug_kit - when debug_kit is not activated, the app runs smoothly (apparently ignoring / not using the test connection)
having debug_kit enabled and then just deleting “test” connection makes my app work again AND have debug_kit up and running
I’d still be into finding out, what component is trying to use the test connection (or is it debug_kit?). Maybe that would be even an addition to the error message? So not only the connection - but also who used the connection?
So it was my “test” connection in the app_local. But it seems like it’s not been checked explicitely - as i can rename the “test” connection to “someconnection” and problem remains. This is reproducible in a fresh install.
Is there any functionality in Debug_Kit probing all available connections?
Here the Debug Kit SQL Panel iterates over all available Datasources, including the test database.
And since the driver for that datasource isn’t available for you you should also set that to Cake\Database\Driver\Sqlite to fix your problem.
Basically calling ConnectionManager::get($name); with that Datasource name as a parameter it will initialise that connection and therefore also check if the set driver is available or not.
Understood. Solution for me will be easy, i commented out the test connection as i’m not using it.
Suggestion:
Looking at the documentation in CakePHP Cookbook for Debug_Kit, the paragraph on Database Configuration is indicating, that only changing the Debug_Kit connection to MySQL should be sufficient (sqlite being absent). However, the “Test” connection is a default connection when initially setting up CakePHP. Chances are, other people not having sqlite run in the same problem initially.
There could either be a hint like “Debug_Kit will initialize all connections, please check for any other sqlite based one.” What do you think?
To be fair it is very unusual that your php environment doesnt have the mysql extension installed. Every shared hoster depends/supports it.
And even if you have a custom server this extension is installed in 1 command.
Ok, I was not aware of that. I know I can install it, it’s just not there by default. I agree: if affected audience is limited and my case is more of an exception, there’s no urgent need for a change.
Anyway, I’m grateful for your help and that it’s working now.