No php-fpm error logs from docker container












0















Using apache + php-fpm containers in docker-compose, I can't get the php-fpm container to display any errors.



docker-compose.yml



version: '3'

services:
php:
build:
context: ./php
ports:
- 9000:9000
volumes:
- ./code:/code
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
environment:
ENVIRONMENT: local
web:
image: httpd:2.4
depends_on:
- php
ports:
- 80:80
volumes:
- ./code:/usr/local/apache2/htdocs
- ./web/httpd.conf:/usr/local/apache2/conf/httpd.conf
depends_on:
- php


php-fpm Dockerfile:



FROM php:5.6-fpm 


php-fpm www.conf:



[global]
error_log = /proc/self/fd/2

[www]

user = www-data
group = www-data

listen = nginx:9000

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

; Logging

; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes

php_flag[display_errors] = on
php_admin_flag[log_errors] = on
;php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
php_admin_value[display_startup_errors] = on


docker-compose logs only shows php-fpm access logs, no error logs.



Tried all solutions proposed in post proposed as possible duplicate: PHP-FPM doesn't write to error log
None of them worked for me, check my comments down below.










share|improve this question

























  • Possible duplicate of PHP-FPM doesn't write to error log

    – Boban
    Nov 21 '18 at 17:55











  • That poster is not using Docker?

    – syst0m
    Nov 21 '18 at 21:05











  • Shouldn't really make a difference @syst0m

    – George Appleton
    Nov 21 '18 at 23:11











  • Personally I specify my error log location under php.ini conf.d in a vhosts.ini file. I've had no issues with it, I'm using the php 7.2 version of the same image as you. Can you check that your conf files have all taken affect by "ssh"ing into your container docker exec -it {php container name} bash and running all the needed commands/tests.

    – George Appleton
    Nov 21 '18 at 23:14











  • I already have this directive "catch_workers_output = yes" present. Check the www.conf I posted.

    – syst0m
    Nov 22 '18 at 11:11
















0















Using apache + php-fpm containers in docker-compose, I can't get the php-fpm container to display any errors.



docker-compose.yml



version: '3'

services:
php:
build:
context: ./php
ports:
- 9000:9000
volumes:
- ./code:/code
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
environment:
ENVIRONMENT: local
web:
image: httpd:2.4
depends_on:
- php
ports:
- 80:80
volumes:
- ./code:/usr/local/apache2/htdocs
- ./web/httpd.conf:/usr/local/apache2/conf/httpd.conf
depends_on:
- php


php-fpm Dockerfile:



FROM php:5.6-fpm 


php-fpm www.conf:



[global]
error_log = /proc/self/fd/2

[www]

user = www-data
group = www-data

listen = nginx:9000

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

; Logging

; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes

php_flag[display_errors] = on
php_admin_flag[log_errors] = on
;php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
php_admin_value[display_startup_errors] = on


docker-compose logs only shows php-fpm access logs, no error logs.



Tried all solutions proposed in post proposed as possible duplicate: PHP-FPM doesn't write to error log
None of them worked for me, check my comments down below.










share|improve this question

























  • Possible duplicate of PHP-FPM doesn't write to error log

    – Boban
    Nov 21 '18 at 17:55











  • That poster is not using Docker?

    – syst0m
    Nov 21 '18 at 21:05











  • Shouldn't really make a difference @syst0m

    – George Appleton
    Nov 21 '18 at 23:11











  • Personally I specify my error log location under php.ini conf.d in a vhosts.ini file. I've had no issues with it, I'm using the php 7.2 version of the same image as you. Can you check that your conf files have all taken affect by "ssh"ing into your container docker exec -it {php container name} bash and running all the needed commands/tests.

    – George Appleton
    Nov 21 '18 at 23:14











  • I already have this directive "catch_workers_output = yes" present. Check the www.conf I posted.

    – syst0m
    Nov 22 '18 at 11:11














0












0








0








Using apache + php-fpm containers in docker-compose, I can't get the php-fpm container to display any errors.



docker-compose.yml



version: '3'

services:
php:
build:
context: ./php
ports:
- 9000:9000
volumes:
- ./code:/code
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
environment:
ENVIRONMENT: local
web:
image: httpd:2.4
depends_on:
- php
ports:
- 80:80
volumes:
- ./code:/usr/local/apache2/htdocs
- ./web/httpd.conf:/usr/local/apache2/conf/httpd.conf
depends_on:
- php


php-fpm Dockerfile:



FROM php:5.6-fpm 


php-fpm www.conf:



[global]
error_log = /proc/self/fd/2

[www]

user = www-data
group = www-data

listen = nginx:9000

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

; Logging

; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes

php_flag[display_errors] = on
php_admin_flag[log_errors] = on
;php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
php_admin_value[display_startup_errors] = on


docker-compose logs only shows php-fpm access logs, no error logs.



Tried all solutions proposed in post proposed as possible duplicate: PHP-FPM doesn't write to error log
None of them worked for me, check my comments down below.










share|improve this question
















Using apache + php-fpm containers in docker-compose, I can't get the php-fpm container to display any errors.



docker-compose.yml



version: '3'

services:
php:
build:
context: ./php
ports:
- 9000:9000
volumes:
- ./code:/code
- ./php/www.conf:/usr/local/etc/php-fpm.d/www.conf
environment:
ENVIRONMENT: local
web:
image: httpd:2.4
depends_on:
- php
ports:
- 80:80
volumes:
- ./code:/usr/local/apache2/htdocs
- ./web/httpd.conf:/usr/local/apache2/conf/httpd.conf
depends_on:
- php


php-fpm Dockerfile:



FROM php:5.6-fpm 


php-fpm www.conf:



[global]
error_log = /proc/self/fd/2

[www]

user = www-data
group = www-data

listen = nginx:9000

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

; Logging

; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes

php_flag[display_errors] = on
php_admin_flag[log_errors] = on
;php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
php_admin_value[display_startup_errors] = on


docker-compose logs only shows php-fpm access logs, no error logs.



Tried all solutions proposed in post proposed as possible duplicate: PHP-FPM doesn't write to error log
None of them worked for me, check my comments down below.







php apache docker docker-compose






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 14:04







syst0m

















asked Nov 21 '18 at 17:25









syst0msyst0m

315




315













  • Possible duplicate of PHP-FPM doesn't write to error log

    – Boban
    Nov 21 '18 at 17:55











  • That poster is not using Docker?

    – syst0m
    Nov 21 '18 at 21:05











  • Shouldn't really make a difference @syst0m

    – George Appleton
    Nov 21 '18 at 23:11











  • Personally I specify my error log location under php.ini conf.d in a vhosts.ini file. I've had no issues with it, I'm using the php 7.2 version of the same image as you. Can you check that your conf files have all taken affect by "ssh"ing into your container docker exec -it {php container name} bash and running all the needed commands/tests.

    – George Appleton
    Nov 21 '18 at 23:14











  • I already have this directive "catch_workers_output = yes" present. Check the www.conf I posted.

    – syst0m
    Nov 22 '18 at 11:11



















  • Possible duplicate of PHP-FPM doesn't write to error log

    – Boban
    Nov 21 '18 at 17:55











  • That poster is not using Docker?

    – syst0m
    Nov 21 '18 at 21:05











  • Shouldn't really make a difference @syst0m

    – George Appleton
    Nov 21 '18 at 23:11











  • Personally I specify my error log location under php.ini conf.d in a vhosts.ini file. I've had no issues with it, I'm using the php 7.2 version of the same image as you. Can you check that your conf files have all taken affect by "ssh"ing into your container docker exec -it {php container name} bash and running all the needed commands/tests.

    – George Appleton
    Nov 21 '18 at 23:14











  • I already have this directive "catch_workers_output = yes" present. Check the www.conf I posted.

    – syst0m
    Nov 22 '18 at 11:11

















Possible duplicate of PHP-FPM doesn't write to error log

– Boban
Nov 21 '18 at 17:55





Possible duplicate of PHP-FPM doesn't write to error log

– Boban
Nov 21 '18 at 17:55













That poster is not using Docker?

– syst0m
Nov 21 '18 at 21:05





That poster is not using Docker?

– syst0m
Nov 21 '18 at 21:05













Shouldn't really make a difference @syst0m

– George Appleton
Nov 21 '18 at 23:11





Shouldn't really make a difference @syst0m

– George Appleton
Nov 21 '18 at 23:11













Personally I specify my error log location under php.ini conf.d in a vhosts.ini file. I've had no issues with it, I'm using the php 7.2 version of the same image as you. Can you check that your conf files have all taken affect by "ssh"ing into your container docker exec -it {php container name} bash and running all the needed commands/tests.

– George Appleton
Nov 21 '18 at 23:14





Personally I specify my error log location under php.ini conf.d in a vhosts.ini file. I've had no issues with it, I'm using the php 7.2 version of the same image as you. Can you check that your conf files have all taken affect by "ssh"ing into your container docker exec -it {php container name} bash and running all the needed commands/tests.

– George Appleton
Nov 21 '18 at 23:14













I already have this directive "catch_workers_output = yes" present. Check the www.conf I posted.

– syst0m
Nov 22 '18 at 11:11





I already have this directive "catch_workers_output = yes" present. Check the www.conf I posted.

– syst0m
Nov 22 '18 at 11:11












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53417572%2fno-php-fpm-error-logs-from-docker-container%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53417572%2fno-php-fpm-error-logs-from-docker-container%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

'app-layout' is not a known element: how to share Component with different Modules