Skip to content

Commit

Permalink
feat(php): make php.ini settings more production like by default
Browse files Browse the repository at this point in the history
  • Loading branch information
damienwebdev committed Nov 24, 2020
1 parent cf8a7c8 commit 8d982be
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 13 deletions.
22 changes: 21 additions & 1 deletion php/7.2/alpine/conf/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
;; Stock PHP Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user.
; Value "stderr" sends the errors to stderr instead of stdout.
display_errors = Off

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors.
display_startup_errors = Off

; Besides displaying errors, PHP can also log errors to locations such as a
; server-specific log, STDERR, or a location specified by the error_log
; directive found below.
log_errors = On

; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for.
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

; This sets the maximum amount of memory in bytes that a script is allowed to allocate.
; This helps prevent poorly written scripts for eating up all available memory on a server.
; Note that to have no memory limit, set this directive to -1.
Expand All @@ -12,7 +29,10 @@ memory_limit = 4G
; The default setting is 30. When running PHP from the command line the default setting is 0.
max_execution_time = 30

date.timezone = UTC
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
max_input_time = 30

; The maximum size of an uploaded file. When an integer is used, the value is measured in bytes.
; Shorthand notation may also be used.
Expand Down
27 changes: 21 additions & 6 deletions php/7.3/alpine/conf/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
;; Stock PHP Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user.
; Value "stderr" sends the errors to stderr instead of stdout.
display_errors = Off

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors.
display_startup_errors = Off

; Besides displaying errors, PHP can also log errors to locations such as a
; server-specific log, STDERR, or a location specified by the error_log
; directive found below.
log_errors = On

; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for.
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

; This sets the maximum amount of memory in bytes that a script is allowed to allocate.
; This helps prevent poorly written scripts for eating up all available memory on a server.
; Note that to have no memory limit, set this directive to -1.
Expand All @@ -12,7 +29,10 @@ memory_limit = 4G
; The default setting is 30. When running PHP from the command line the default setting is 0.
max_execution_time = 30

date.timezone = UTC
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
max_input_time = 30

; The maximum size of an uploaded file. When an integer is used, the value is measured in bytes.
; Shorthand notation may also be used.
Expand All @@ -23,11 +43,6 @@ upload_max_filesize = 20M
; larger than post_max_size. When an integer is used, the value is measured in bytes. Shorthand notation may also be used.
post_max_size = 20M

; Whether to transparently compress pages. If this option is set to "On" in php.ini or the Apache configuration,
; pages are compressed if the browser sends an "Accept-Encoding: gzip" or "deflate" header.
; "Content-Encoding: gzip" (respectively "deflate") and "Vary: Accept-Encoding" headers are added to the output.
zlib.output_compression = On

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; OPcache Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
27 changes: 21 additions & 6 deletions php/7.4/alpine/conf/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
;; Stock PHP Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user.
; Value "stderr" sends the errors to stderr instead of stdout.
display_errors = Off

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors.
display_startup_errors = Off

; Besides displaying errors, PHP can also log errors to locations such as a
; server-specific log, STDERR, or a location specified by the error_log
; directive found below.
log_errors = On

; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for.
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

; This sets the maximum amount of memory in bytes that a script is allowed to allocate.
; This helps prevent poorly written scripts for eating up all available memory on a server.
; Note that to have no memory limit, set this directive to -1.
Expand All @@ -12,7 +29,10 @@ memory_limit = 4G
; The default setting is 30. When running PHP from the command line the default setting is 0.
max_execution_time = 30

date.timezone = UTC
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
max_input_time = 30

; The maximum size of an uploaded file. When an integer is used, the value is measured in bytes.
; Shorthand notation may also be used.
Expand All @@ -23,11 +43,6 @@ upload_max_filesize = 20M
; larger than post_max_size. When an integer is used, the value is measured in bytes. Shorthand notation may also be used.
post_max_size = 20M

; Whether to transparently compress pages. If this option is set to "On" in php.ini or the Apache configuration,
; pages are compressed if the browser sends an "Accept-Encoding: gzip" or "deflate" header.
; "Content-Encoding: gzip" (respectively "deflate") and "Vary: Accept-Encoding" headers are added to the output.
zlib.output_compression = On

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; OPcache Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down

0 comments on commit 8d982be

Please sign in to comment.