Did some more testing and I think this might be an issue with Kirby after all. Using plain PHP (no Kirby) with my existing PHP settings, I can get errors logged just fine!
Any help with this would be hugely appreciated.
Without Kirby
If I use this nginx config:
server {
listen 80 default_server;
root /var/www/html;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location /index.php {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
}
And put this file in /var/www/html/index.php:
<?= noSuchFunction() ?>
Then, when I run curl localhost/index.php
, I get the following output in /var/log/nginx/error.log:
2021/03/03 10:58:18 [error] 31857#31857: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function noSuchFunction() in /var/www/html/index.php:1
Stack trace:
#0 {main}
thrown in /var/www/html/index.php on line 1" while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "localhost"
Nice!
With Kirby
If I now try to reproduce this with Kirby, I still don’t get any error logs.
Keeping the same nginx config, I put this in /var/www/html/site/templates/home.php
<?= noSuchFunction() ?>
Now when I run curl localhost/home
, I get a 500 error repsonse, but no output regarding the error in the nginx error log or anywhere else.
My current Kirby config, in case it’s relevant:
<?php
return [
'auth' => [
'methods' => 'code'
],
'cache' => [
'pages' => [
'active' => false
]
],
'languages' => true,
'panel' => [
'install' => true
]
];