debug_kit
debug_kit copied to clipboard
DebugKit not showing on fresh CakePHP 5 installation
After a fresh CakePHP 5.0.5 I activated DebugKit by adding this code to Application.php
if (Configure::read('debug')) {
Configure::write('DebugKit.safeTld', ['mydomain.net']);
Configure::write('DebugKit.forceEnable', true);
$this->addPlugin('DebugKit');
}
I've set 'debug'=>true, in app_local.php as well.
On the default CakePHP it says that DebugKit is loaded and can connect to the DB, however I'm getting the error in the image.
If I comment the line:
//Configure::write('DebugKit.forceEnable', true);
I can have the error gone but DebugKit still not loading.
What is it wrong here?
The debug_kit will automatically be enabled if you have the debug_mode enabled due to how its configured in your config/plugins.php
You don't need to add it again in your Application.php
The fact that you get this error template means you have at least the debug mode enabled.
Anyway I am not able to reproduce your problem. Please make sure your PHP has the sqlite extension enabled and that your sqlite library is not too old.
I am using PHP 8.1.26 and SQLite 3.44.0 (check via php -i | grep SQLite)
What version sqlite is on your system?
You don't need to add it again in your Application.php
Well you're right about that.
I'm using PHP 4.2.14 and
PDO Driver for SQLite 3.x => enabled SQLite Library => 3.7.17 SQLite3 support => enabled SQLite Library => 3.7.17
The weird thing is that I have other 3 projects running Cakephp 4.5.x in the same server (VPS), only this installation (v5.0.5) throws the error.
Sqlite 3.7 is a very old release.
I'm using PHP 4.2.14 and
What???
I'm using PHP 4.2.14 and
What???
8.2.14 sorry... And just upgraded to 8.3.1 and got more errors
Warning: You should set `zend.assertions` to `1` in your php.ini for your development environment. in /home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Core/Configure.php on line 102
Warning (2) : Undefined array key "origin" [in /home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Database/Schema/SqliteSchemaDialect.php, line 339]
Warning (2) : Undefined array key "origin" [in /home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Database/Schema/SqliteSchemaDialect.php, line 354]
Warning (512) : Unable to emit headers. Headers sent in file=/home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Core/Configure.php line=102 [in /home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 65]
Warning (2) : Cannot modify header information - headers already sent by (output started at /home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Core/Configure.php:102) [in /home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 159]
Warning (2) : Cannot modify header information - headers already sent by (output started at /home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Core/Configure.php:102) [in /home/autumnws/public_html/labs/jaramillo/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 192]
This was added in https://github.com/cakephp/cakephp/pull/17256
@ndm2 Do you know the required sqlite version required for this?
Do you know the required sqlite version required for this?
From the PR
It should be noted that the FK handling changes would require at least Sqlite 3.16.0
I think we should add a version check in the sqlite driver and throw an exception which devs can understand.
Missed the very last sentence. We can update the 5.0 migration docs and add a version to the database list (although no one reads that).
I probably should've thought of a possible version based exception, sorry, I didn't really anticipate people using 6+ years old Sqlite versions, let alone 10 year old ones 🙃
Well, that's the problem, maybe it's a good idea to state the minimal version of all the needed stuff. In my case, I couldn't upgrade SQLite so I had to connect to a Mysql DB and that solved the problem.
I am just curious now: What OS are you running so that a PHP 8.2 installation can live parallel to such an ancient sqlite library... This probably isn't Docker or any Debian based system.
I am just curious now: What OS are you running so that a PHP 8.2 installation can live parallel to such an ancient sqlite library... This probably isn't Docker or any Debian based system.
PHP 8.3 lol... And it's a CentOS server
CentOS
It's always CentOS with such issues. It's an abomination of a distro. In the past too we had to deal with numerous reports from CentOS users because it had very outdated ICU libs.
Did you try running a docker container setup and see if that works? Instead of using the native PHP/SQL stack on your system?
On my linux mint I for example use https://github.com/cytopia/devilbox which out of the box works with CakePHP and is much more easy to configure than a local system would be, especially in your case. I never had any issues here, especiallly not with DebugKit. Just an idea.
If there is not much more there can be done, I wonder if we should close.