Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 62 additions & 78 deletions root-files/opt/flownative/php/etc/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@
short_open_tag = Off

; Enables or disables the circular reference collector.
; http://php.net/zend.enable-gc
; https://php.net/zend.enable-gc
zend.enable_gc = On

; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header). It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
; http://php.net/expose-php
; https://php.net/expose-php
expose_php = Off

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; https://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 240

; Maximum amount of time each script may spend parsing request data. It\'s a good
; 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.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
; https://php.net/max-input-time
max_input_time = 60

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
; Maximum amount of memory a script may consume
; https://php.net/memory-limit
memory_limit = ${PHP_MEMORY_LIMIT}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -49,97 +49,86 @@ error_reporting = ${PHP_ERROR_REPORTING}
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; https://php.net/display-errors

display_errors = ${PHP_DISPLAY_ERRORS}

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. We strongly recommend you set this to 'off'
; for production servers to avoid leaking configuration details.
; Default Value: On
; Development Value: On
; Production Value: Off
; https://php.net/display-startup-errors
;display_startup_errors = Off
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should set this, I think, to be in line with display_errors and the recommendation for production.

Suggested change
;display_startup_errors = Off
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. While errors should not be displayed on productions
; servers they should still be monitored and logging is a great way to do that.
; Default Value: Off
; Development Value: On
; Production Value: On
; http://php.net/log-errors
; https://php.net/log-errors
log_errors = On

error_log = ${PHP_ERROR_LOG}

; Store the last error/warning message in \$php_errormsg (boolean). Setting this value
; to On can assist in debugging and is appropriate for development servers. It should
; however be disabled on production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/track-errors
track_errors = Off

; When PHP displays or logs an error, it has the capability of formatting the
; error message as HTML for easier reading. This directive controls whether
; the error message is formatted as HTML or not.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: On
; Development Value: On
; Production value: On
; http://php.net/html-errors
; https://php.net/html-errors
html_errors = Off

; This directive determines whether PHP registers \$argv & \$argc each time it
; runs. \$argv contains an array of all the arguments passed to PHP when a script
; is invoked. \$argc contains an integer representing the number of arguments
; This directive determines whether PHP registers $argv & $argc each time it
; runs. $argv contains an array of all the arguments passed to PHP when a script
; is invoked. $argc contains an integer representing the number of arguments
; that were passed when the script was invoked. These arrays are extremely
; useful when running scripts from the command line. When this directive is
; enabled, registering these variables consumes CPU cycles and memory each time
; a script is executed. For performance reasons, this feature should be disabled
; on production servers.
; Note: This directive is hardcoded to On for the CLI SAPI
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/register-argc-argv
; a script is executed. For security reasons, this feature should be disabled
; for non-CLI SAPIs.
; Note: This directive is ignored for the CLI SAPI
; This directive is deprecated with PHP 8.5.
; https://php.net/register-argc-argv
register_argc_argv = Off

; When enabled, the ENV, REQUEST and SERVER variables are created when they\'re
; When enabled, the ENV, REQUEST and SERVER variables are created when they're
; first used (Just In Time) instead of when the script starts. If these
; variables are not used within a script, having this directive on will result
; in a performance gain. The PHP directive register_argc_argv must be disabled
; for this directive to have any affect.
; http://php.net/auto-globals-jit
; for this directive to have any effect.
; https://php.net/auto-globals-jit
auto_globals_jit = On

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
; https://php.net/post-max-size
post_max_size = 500M

; By default, PHP will output a character encoding using
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
; By default, PHP will output a media type using the Content-Type header. To
; disable this, simply set it to be empty.
;
; PHP\'s built-in default is text/html
; http://php.net/default-mimetype
; PHP's built-in default media type is set to text/html.
; https://php.net/default-mimetype
default_mimetype = "text/html"

; PHP\'s default character set is set to empty.
; http://php.net/default-charset
; PHP's default character set is set to UTF-8.
; https://php.net/default-charset
default_charset = "UTF-8"

; Always populate the \$HTTP_RAW_POST_DATA variable. PHP\'s default behavior is
; to disable this feature. If post reading is disabled through
; enable_post_data_reading, \$HTTP_RAW_POST_DATA is *NOT* populated.
; http://php.net/always-populate-raw-post-data
;always_populate_raw_post_data = On

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
; https://php.net/file-uploads
file_uploads = On

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
; https://php.net/upload-max-filesize
upload_max_filesize = 500M

; Maximum number of files that can be uploaded via a single request
Expand All @@ -155,9 +144,21 @@ cli_server.color = On

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
; https://php.net/date.timezone
date.timezone = ${PHP_DATE_TIMEZONE}

[Assertion]
; Switch whether to compile assertions at all (to have no overhead at run-time)
; -1: Do not compile at all
; 0: Jump over assertion at run-time
; 1: Execute assertions
; Changing from or to a negative value is only possible in php.ini!
; (For turning assertions on and off at run-time, toggle zend.assertions between the values 1 and 0)
; Default Value: 1
; Development Value: 1
; Production Value: -1
; https://php.net/zend.assertions
;zend.assertions = -1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
;zend.assertions = -1
zend.assertions = -1

Unless we are sure this is needed, we should probably set this to follow the recommendation for production!?


[opcache]
; Load the opcache extension - only needed in PHP up to 8.4
Expand All @@ -173,10 +174,10 @@ opcache.enable=1
opcache.memory_consumption=80M

; The amount of memory for interned strings in Mbytes.
;opcache.interned_strings_buffer=4
;opcache.interned_strings_buffer=8

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
; Only numbers between 200 and 1000000 are allowed.
opcache.max_accelerated_files=5000
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
opcache.max_accelerated_files=5000
opcache.max_accelerated_files=30000

A Flow project easily has upwards of 25000 class files… so it seems raising this might be good?


; The maximum percentage of "wasted" memory until a restart is scheduled.
Expand Down Expand Up @@ -204,22 +205,18 @@ opcache.max_accelerated_files=5000
; size of the optimized code.
opcache.save_comments=1

; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
; may be always stored (save_comments=1), but not loaded by applications
; that don\'t need them anyway.
;opcache.load_comments=1

; If enabled, a fast shutdown sequence is used for the accelerated code
;opcache.fast_shutdown=0
; If enabled, compilation warnings (including notices and deprecations) will
; be recorded and replayed each time a file is included. Otherwise, compilation
; warnings will only be emitted when the file is first cached.
;opcache.record_warnings=0

; Allow file existence override (file_exists, etc.) performance feature.
;opcache.enable_file_override=1
;opcache.enable_file_override=0

; A bitmask, where each bit enables or disables the appropriate OPcache
; passes
;opcache.optimization_level=0xffffffff
;opcache.optimization_level=0x7FFFBFFF

;opcache.inherited_hack=1
;opcache.dups_fix=0

; The location of the OPcache blacklist file (wildcards allowed).
Expand All @@ -234,10 +231,6 @@ opcache.save_comments=1
; are cached.
;opcache.max_file_size=0

; Check the cache checksum each N requests.
; The default value of "0" means that the checks are disabled.
;opcache.consistency_checks=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180
Expand All @@ -251,18 +244,9 @@ opcache.save_comments=1
; debug messages (level 4).
;opcache.log_verbosity_level=1

; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model=

; Protect the shared memory from unexpected writing during script execution.
; Useful for internal debugging only.
;opcache.protect_memory=0

; Specifies a PHP script that is going to be compiled and executed at server
; start-up, and which may preload other files, either by including them
; or by using the opcache_compile_file() function. All the entities
; (e.g. functions and classes) defined in these files will be available to
; requests out of the box, until the server is shut down.
; start-up.
; https://php.net/opcache.preload
opcache.preload = ${PHP_OPCACHE_PRELOAD}

[xdebug]
Expand Down