|
| 1 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 2 | +; PHP Production Environment Configuration ; |
| 3 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 4 | + |
| 5 | +[PHP] |
| 6 | +; Timezone setting |
| 7 | +date.timezone = UTC |
| 8 | + |
| 9 | +; Error reporting settings - Production focused |
| 10 | +display_errors = Off |
| 11 | +display_startup_errors = Off |
| 12 | +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT |
| 13 | +log_errors = On |
| 14 | +error_log = /var/log/php/php_errors.log |
| 15 | +ignore_repeated_errors = On |
| 16 | +report_memleaks = Off |
| 17 | +html_errors = Off |
| 18 | + |
| 19 | +; Security settings |
| 20 | +expose_php = Off |
| 21 | +disable_functions = system,exec,shell_exec,passthru,proc_open,popen,show_source,phpinfo |
| 22 | + |
| 23 | +; Memory and execution limits - Optimized for production |
| 24 | +memory_limit = 128M |
| 25 | +max_execution_time = 60 |
| 26 | +max_input_time = 60 |
| 27 | +post_max_size = 20M |
| 28 | +upload_max_filesize = 20M |
| 29 | + |
| 30 | +; Request handling |
| 31 | +max_input_vars = 2000 |
| 32 | +realpath_cache_size = 4M |
| 33 | +realpath_cache_ttl = 600 |
| 34 | + |
| 35 | +; Session settings - Secure for production |
| 36 | +session.use_strict_mode = 1 |
| 37 | +session.cookie_httponly = 1 |
| 38 | +session.cookie_secure = 1 |
| 39 | +session.cookie_samesite = "Lax" |
| 40 | +session.gc_maxlifetime = 3600 |
| 41 | +session.use_only_cookies = 1 |
| 42 | +session.gc_probability = 1 |
| 43 | +session.gc_divisor = 100 |
| 44 | + |
| 45 | +; Performance optimizations |
| 46 | +zlib.output_compression = On |
| 47 | +zlib.output_compression_level = 4 |
| 48 | +implicit_flush = Off |
| 49 | + |
| 50 | +; Opcache settings - Production optimized |
| 51 | +opcache.enable = 1 |
| 52 | +opcache.memory_consumption = 256 |
| 53 | +opcache.interned_strings_buffer = 16 |
| 54 | +opcache.max_accelerated_files = 20000 |
| 55 | +opcache.revalidate_freq = 60 |
| 56 | +opcache.validate_timestamps = 0 |
| 57 | +opcache.fast_shutdown = 1 |
| 58 | +opcache.enable_file_override = 1 |
| 59 | +opcache.save_comments = 1 |
| 60 | +opcache.enable_cli = 0 |
| 61 | +opcache.huge_code_pages = 1 |
| 62 | +opcache.jit = 1255 |
| 63 | +opcache.jit_buffer_size = 128M |
| 64 | + |
| 65 | +; File handling |
| 66 | +allow_url_fopen = Off |
| 67 | +file_uploads = On |
| 68 | +default_socket_timeout = 30 |
| 69 | + |
| 70 | +; Xdebug is disabled in production |
| 71 | +[Xdebug] |
| 72 | +xdebug.mode = off |
0 commit comments