I'm using php-fpm with Caddy and I cannot make php-fpm log errors. Previously I used nginx and nginx captures and displays php errors in its own logs quite nicely, so I never had an issue, but with caddy I decided to enable php-fpm error log, and it just... doesn't work. But let's start from the beginning:
OS: Ubuntu 22.04.1
App: Symfony 7.1 with monolog (mentioning it in case it stops error propagation or whatever)
Caddy v2.8.4 config:
[REDACTED] { tls [REDACTED] root * [REDACTED] file_server php_fastcgi unix//var/run/php/php8.3-fpm.sock log { output file /var/log/caddy/[REDACTED].log level ERROR } php-fpm 8.3.12 pool configuration:
 listen = /var/run/php/php8.3-fpm.sock listen.owner = [REDACTED] listen.group = www-data pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 user = [REDACTED] group = www-data php_value[memory_limit] = 8G catch_workers_output = yes php_flag[display_errors] = on php_admin_value[error_log] = /var/log/php-fpm/[REDACTED].log php_admin_flag[log_errors] = on The main php-fpm log works just fine, but it just contains information about service restarts basically, so it's not very useful. The log belonging to the pool is not saved.
What I did:
- I made sure that permissions and ownership of the log files are correctly set. Log file exists. I touched it, and copy-pasted paths to avoid any typos. The/var/log/php-fpmdirectory is777just as the log file. It's temporary to exclude any permission reasons.
- I can see in phpinfothat values set in the pool configuration take effect.
- I restarted everything.
- When I visit a page returning error 500, no log is saved. The logs file is always empty.
Is there anything else am I missing? Does anyone have any idea where I could look at, to figure this out?
