|
| 1 | +; On the CLI we want errors to be sent to stdout -> those will end up in CloudWatch |
| 2 | +; In FPM workers we don't want that, but that is overridden by Bref when it starts PHP-FPM |
| 3 | +display_errors=1 |
| 4 | + |
| 5 | +; Since PHP 7.4 the default value is E_ALL |
| 6 | +; We override it to set the recommended configuration value for production. |
| 7 | +; See https://github.com/php/php-src/blob/d91abf76e01a3c39424e8192ad049f473f900936/php.ini-production#L463 |
| 8 | +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT |
| 9 | + |
| 10 | +memory_limit=10240M |
| 11 | + |
| 12 | +opcache.enable=1 |
| 13 | +opcache.enable_cli=1 |
| 14 | + |
| 15 | +; Store the opcodes into a file cache (on top of storing in memory) |
| 16 | +; With FPM, this is only useful if FPM restarts or if the shared memory cache is full. |
| 17 | +; With the function runtime, this is useful when the function restarts the PHP |
| 18 | +; process on every invocation. |
| 19 | +; TODO store in a subdirectory (but the problem is that the subdirectory doesn't exist when PHP starts...) |
| 20 | +opcache.file_cache="/tmp" |
| 21 | +; Disable the memory cache since it's useless |
| 22 | +; In my tests it allows to gain 30% of response time in a classic API controller |
| 23 | +opcache.file_cache_only=1 |
| 24 | +; Skip this check to save a bit |
| 25 | +opcache.validate_permission=0 |
| 26 | + |
| 27 | +; The code is readonly on lambdas so it never changes |
| 28 | +; This setting is now disabled: code could be written to /tmp which is read/write |
| 29 | +; (e.g. a compiled container) Such a performance optimization can be done by users. |
| 30 | +;opcache.validate_timestamps=0 |
| 31 | + |
| 32 | +; Set sane values, modern PHP applications have higher needs than opcache's defaults |
| 33 | +; See https://tideways.com/profiler/blog/fine-tune-your-opcache-configuration-to-avoid-caching-suprises |
| 34 | +opcache.memory_consumption=128 |
| 35 | +opcache.max_accelerated_files=10000 |
| 36 | + |
| 37 | +; This directive determines which super global arrays are registered when PHP |
| 38 | +; starts up. G,P,C,E & S are abbreviations for the following respective super |
| 39 | +; globals: GET, POST, COOKIE, ENV and SERVER. |
| 40 | +; We explicitly populate all variables else ENV is not populated by default. |
| 41 | +; See https://github.com/brefphp/bref/pull/291 |
| 42 | +variables_order="EGPCS" |
| 43 | + |
| 44 | +; The lambda environment is not compatible with fastcgi_finish_request |
| 45 | +; See https://github.com/brefphp/bref/issues/214 |
| 46 | +disable_functions=fastcgi_finish_request |
| 47 | + |
| 48 | +; The total upload size limit is 6Mb, we override the defaults to match this limit |
| 49 | +; API Gateway has a 10Mb limit, but Lambda's is 6Mb |
| 50 | +post_max_size=6M |
| 51 | +upload_max_filesize=6M |
| 52 | + |
| 53 | +extension_dir=/opt/bref/extensions |
0 commit comments