moodle-php-apache icon indicating copy to clipboard operation
moodle-php-apache copied to clipboard

Various helpers are polluting stdout, making the output of php scripts to become borked

Open stronk7 opened this issue 1 year ago • 0 comments

Along the last months we have added a bunch of nice extras to the images (support for entrypoints, php.ini settings and extensions enable and disabling.

But there is a problem, because all them are sending to stdout information. Say:

Checking for php configuration in environment
Running PHP Configuration fetcher
Running entrypoint files from /docker-entrypoint.d
Found extension to enable:
...

And that makes simple execution of PHP scripts to become borked, for example:

$ docker run -it --rm moodlehq/moodle-php-apache:8.1-buster php -r 'echo PHP_VERSION;'
Running PHP Configuration fetcher
Checking for php configuration in environment

Running entrypoint files from /docker-entrypoint.d/*

Starting docker-php-entrypoint with php -r echo PHP_VERSION;
8.1.20

All that information shouldn't go to stdout (maybe stderr?) or, at very least, there should be an option to make all the initialisation quiet. Goal, to get exclusively the php execution results at stdout.

Ciao :-)

stronk7 avatar Aug 06 '23 08:08 stronk7