No php-fpm error logs from docker container No php-fpm error logs from docker container apache apache

No php-fpm error logs from docker container


Struggle hours to get this working.

In the file docker-compose.yml I mounted my logs (so they persist)

        volumes:        - ./phpSettings.conf:/usr/local/etc/php-fpm.d/zzz-phpSettings.conf        - ./logs/php-error.log:/var/log/error.log        - ./logs/php-access.log:/var/log/access.log

In the phpSettings.conf file I have this:

[www]user = www-datagroup = www-datalisten = 0.0.0.0:9000pm = dynamicpm.max_children = 5pm.start_servers = 2pm.min_spare_servers = 1pm.max_spare_servers = 3catch_workers_output = yesphp_admin_flag[log_errors] = onphp_admin_flag[display_errors] = offphp_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATEDphp_admin_value[error_log] = /var/log/error.logaccess.log = /var/log/access.logphp_value[memory_limit] = 512Mphp_value[post_max_size] = 24Mphp_value[upload_max_filesize] = 24M

Make sure the mounted log files exist before starting the docker.

the trick seems to be naming my settings zzz-phpSettings.conf so is the last one to load. I overwrite the default docker php image www.conf settings with the very same settings (except the listen 0.0.0.0:9000).

In this php-fpm+Nginx setup I managed to have nginx (error/access) logs to its own location + php-fpm error/access logs to its own place too, so loggins looks really nice.