Skip to content

Commit

Permalink
log PHP errors to a file and tail that instead of having messages bub…
Browse files Browse the repository at this point in the history
…ble up through FPM with annoying message prefixes
  • Loading branch information
dzuelke committed Sep 30, 2014
1 parent 98bcfaa commit c265be6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/heroku-php-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export DOCUMENT_ROOT="$HEROKU_APP_DIR"
export PORT=${PORT:-$(( $RANDOM+1024 ))}

# our standard logs
logs=( "/tmp/heroku.php-fpm.$PORT.log" "/tmp/heroku.apache2_error.$PORT.log" "/tmp/heroku.apache2_access.$PORT.log" )
logs=( "/tmp/heroku.php-fpm.$PORT.log" "/tmp/heroku.php-fpm.www.$PORT.log" "/tmp/heroku.apache2_error.$PORT.log" "/tmp/heroku.apache2_access.$PORT.log" )

optstring=":-:C:c:F:f:i:l:vh"

Expand Down
2 changes: 1 addition & 1 deletion bin/heroku-php-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export DOCUMENT_ROOT="$HEROKU_APP_DIR"
export PORT=${PORT:-$(( $RANDOM+1024 ))}

# our standard logs
logs=( "/tmp/heroku.php-fpm.$PORT.log" "/tmp/heroku.nginx_access.$PORT.log" )
logs=( "/tmp/heroku.php-fpm.$PORT.log" "/tmp/heroku.php-fpm.www.$PORT.log" "/tmp/heroku.nginx_access.$PORT.log" )

optstring=":-:C:c:F:f:i:l:vh"

Expand Down
3 changes: 3 additions & 0 deletions conf/php/php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -527,4 +527,7 @@ clear_env = no
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

; log PHP errors to a file, otherwise they're bubbled up through FPM via stderr
php_value[error_log] = /tmp/heroku.php-fpm.www.${PORT}.log

include=${HEROKU_PHP_FPM_CONFIG_INCLUDE}

0 comments on commit c265be6

Please sign in to comment.