File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11<?php
22
33// NOTE: this file+folder should be replaced by the child app
4+ $ stdout = fopen ( "php://stdout " , 'w ' );
5+ $ stderr = fopen ( "php://stderr " , 'w ' );
6+
7+ fwrite ( $ stdout , 'Using STDOUT pipe for output ' );
8+ fwrite ( $ stderr , 'Using STDERR pipe for output ' );
9+
410phpinfo ();
Original file line number Diff line number Diff line change 5555 sed -i " s/pm.min_spare_servers = [0-9]\+/pm.min_spare_servers = 4/" /etc/php5/fpm/pool.d/www.conf
5656 sed -i " s/pm.max_spare_servers = [0-9]\+/pm.max_spare_servers = 32/" /etc/php5/fpm/pool.d/www.conf
5757
58- # Allow php5-fpm process to pick up stdout and stderr from worker processes
58+ # php5-fpm processes must pick up stdout/ stderr from workers, will cause minor performance decrease (but is required)
5959 sed -i " s/;catch_workers_output/catch_workers_output/" /etc/php5/fpm/pool.d/www.conf
6060
61+
62+ # 1. runs php5-fpm as foreground (-F)
63+ # 2. forcing php5-fpm to log to stderr even if a non-terminal is attached (-O)
64+ # 3. redirect stderr to stdout
65+ # 4. filtering the garbage string that PHP-FPM for no-reason-at-all decided to wrap the message in,
66+ # 5. reconnecting the stdout to current stdout
67+ # 6. backgrounding that process
6168 echo ' Starting PHP-FPM (background)'
62- # php5-fpm --nodaemonize 1> >(sed -u 's/WARNING: \[pool www\] child [0-9]* said into stdout: \"\(.*\)\"$/\1/' >/dev/stdout) \
63- # 2> >(sed -u 's/WARNING: \[pool www\] child [0-9]* said into stderr: \"\(.*\)\"$/\1/' >/dev/stderr) &
64- php5-fpm --nodaemonize &
69+ php5-fpm -F -O 2>&1 | sed -u ' s/WARNING: \[pool www\] child [0-9]* said into std[a-z]*: \"\(.*\)\"$/\1/' 1>&1 &
6570
6671 echo " Starting Nginx (foreground)"
6772 exec /usr/sbin/nginx -g " daemon off;"
6873
69-
7074fi
You can’t perform that action at this time.
0 commit comments