From ffffe7b60c501d617ff9ea9ce12458f902c65b2d Mon Sep 17 00:00:00 2001 From: ojullien Date: Sun, 28 Feb 2021 17:06:19 +0100 Subject: [PATCH] Updates to PHP8 and closes #5, adds Xdebug v3 and closes #4 Signed-off-by: ojullien --- CONTRIBUTING.md | 2 +- LICENSE | 2 +- README.md | 47 +++++----- src/VERSION | 2 +- src/fpm/conf-available/10-php-fpm.conf | 10 +- src/fpm/conf-available/20-domain_01.tld.conf | 5 +- src/fpm/conf-available/20-domain_02.tld.conf | 5 +- src/fpm/conf-available/common.conf | 9 +- src/fpm/conf-available/www.conf | 33 +++++-- src/fpm/phpdisconf.sh | 4 +- src/fpm/phpenconf.sh | 4 +- src/mods-available/zzz-dev.ini | 96 +++++++++----------- src/mods-available/zzz-prod.ini | 77 ++++++++++++++-- 13 files changed, 179 insertions(+), 117 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c650ec7..fed520e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ Pull requests are the best way to propose changes to the codebase. There are war ## Bug and fix -If you encounter any **bugs**, please open an [issue](https://github.com/ojullien/php7.x-fpm/issues/new). +If you encounter any **bugs**, please open an [issue](https://github.com/ojullien/php-fpm/issues/new). **Great Bug Reports** tend to have: diff --git a/LICENSE b/LICENSE index c319582..666b543 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Olivier Jullien +Copyright (c) 2021 Olivier Jullien Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 804a70d..fbe4112 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,27 @@ -# PHP7.x-FPM configuration and pool templates +# PHP-FPM configuration and pool templates -PHP 7.x FPM personnal configuration and pool templates on Debian linux distribution. +PHP-FPM personnal configuration and pool templates on Debian linux distribution. *Note: I use this package for my own projects, it contains only the features I need.* ## Table of Contents -- [Requirements](#requirements) -- [Configuration](#configuration) -- [Pools](#pools) -- [Documentation](#documentation) -- [Contributing](#contributing) -- [License](#license) +[Requirements](#requirements) | [Configuration](#configuration) | [Pools](#pools) | [Documentation](#documentation) | [Contributing](#contributing) | [License](#license) ## Requirements -- Debian linux distribution: ~9.5 -- PHP-FPM: ~7.2 +- Debian linux distribution: ~10.0 +- PHP-FPM: ~8.0 ## Configuration I do not modify any PHP configuration files. I just add new configuration files to override the default PHP configuration. -PHP includes a central configuration file `/etc/php/7.x/fpm/php.ini` and, then, the particular configuration snippets (`/etc/php/7.x/fpm/conf.d/*.ini`) which manage the modules. +PHP includes a central configuration file `/etc/php/8.x/fpm/php.ini` and, then, the particular configuration snippets (`/etc/php/8.x/fpm/conf.d/*.ini`) which manage the modules. -PHP-FPM uses a central configuration file `/etc/php/7.x/fpm/php-fpm.ini` and configures the pools using conf files located in `/etc/php/7.x/fpm/pool.d/` +PHP-FPM uses a central configuration file `/etc/php/8.x/fpm/php-fpm.ini` and configures the pools using conf files located in `/etc/php/8.x/fpm/pool.d/` + +Log directory is `/var/log/php/` ### Files @@ -33,7 +30,7 @@ PHP-FPM uses a central configuration file `/etc/php/7.x/fpm/php-fpm.ini` and con ### How to setup the PHP personnal configuration -1. Copy the configuration [files](/src/mods-available) into `/etc/php/7.x/mods-available/` +1. Copy the configuration [files](/src/mods-available) into `/etc/php/8.x/mods-available/` 2. Edit the named like zzz-***.ini files and make changes as you need. 3. Enable the configuration you need using `phpenmod zzz-***` 4. Review your settings using `php -i` @@ -56,18 +53,18 @@ Each pool runs under is own user/group process (see [adduser](https://manpages.d ### How to setup the pools -*Note: replace x by the minor version of PHP. Ex: php-fpm7.x -t becomes php-fpm7.2 -t* +*Note: replace x by the minor version of PHP. Ex: php-fpm8.x --test becomes php-fpm8.0 --test* -1. Copy all the [files and directories](/src/fpm) into /etc/php/7.x/fpm -2. Move the default pool from `/etc/php/7.x/fpm/pool.d/www.conf` to `/etc/php/7.x/fpm/conf-available/www.conf` -3. Make executable the `phpdisconf.sh` script file using `chmod u+x /etc/php/7.x/fpm/phpdisconf.sh` -4. Make executable the `phpenconf.sh` script file using `chmod u+x /etc/php/7.x/fpm/phpenconf.sh` -5. Edit the FPM configuration file (`/etc/php/7.x/fpm/conf-available/10-php-fpm.conf`) and make changes as you need. +1. Copy all the [files and directories](/src/fpm) into /etc/php/8.x/fpm +2. Move the default pool from `/etc/php/8.x/fpm/pool.d/www.conf` to `/etc/php/8.x/fpm/conf-available/www.conf` +3. Make executable the `phpdisconf.sh` script file using `chmod u+x /etc/php/8.x/fpm/phpdisconf.sh` +4. Make executable the `phpenconf.sh` script file using `chmod u+x /etc/php/8.x/fpm/phpenconf.sh` +5. Edit the FPM configuration file (`/etc/php/8.x/fpm/conf-available/10-php-fpm.conf`) and make changes as you need. 6. Enable yours FPM settings using `./phpenconf.sh 10-php-fpm` -7. Edit the named like `/etc/php/7.x/fpm/conf-available/20-***.conf` files and make changes as you need. +7. Edit the named like `/etc/php/8.x/fpm/conf-available/20-***.conf` files and make changes as you need. 8. Enable the pools using `./phpenconf.sh 20-domain_01.tld 20-domain_02.tld` -9. Test the validity of your php-fpm configuration syntax using `php-fpm7.x -t` -10. Restart the PHP-FPM using `systemctl restart php7.x-fpm.service` +9. Test the validity of your php-fpm configuration syntax using `php-fpm8.0 --test` +10. Restart the PHP-FPM using `systemctl restart php8.x-fpm.service` ## Documentation @@ -79,12 +76,12 @@ For instructions on how to use, best practices, templates and other usage inform Thanks you for taking the time to contribute. Please fork the repository and make changes as you'd like. -As I use these configuration and templates for my own projects, it contains only the features I need. But If you have any ideas, just open an [issue](https://github.com/ojullien/php7.x-fpm/issues) and tell me what you think. Pull requests are also warmly welcome. +As I use these configuration and templates for my own projects, it contains only the features I need. But If you have any ideas, just open an [issue](https://github.com/ojullien/php-fpm/issues) and tell me what you think. Pull requests are also warmly welcome. -If you encounter any **bugs** in the configuration or templates, please open an [issue](https://github.com/ojullien/php7.x-fpm/issues). +If you encounter any **bugs** in the configuration or templates, please open an [issue](https://github.com/ojullien/php-fpm/issues). Be sure to include a title and clear description,as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. ## License -**php7.x-fpm configuration and templates** are open-source and are licensed under the [MIT License](https://github.com/ojullien/php7.x-fpm/blob/master/LICENSE). +**php-fpm configuration and templates** are open-source and are licensed under the [MIT License](https://github.com/ojullien/php-fpm/blob/master/LICENSE). diff --git a/src/VERSION b/src/VERSION index 26af270..e3dfd68 100644 --- a/src/VERSION +++ b/src/VERSION @@ -1 +1 @@ -20200129 +20210228 diff --git a/src/fpm/conf-available/10-php-fpm.conf b/src/fpm/conf-available/10-php-fpm.conf index db6afe6..2187021 100644 --- a/src/fpm/conf-available/10-php-fpm.conf +++ b/src/fpm/conf-available/10-php-fpm.conf @@ -1,11 +1,10 @@ ;; ----------------------------------------------------- -;; PHP 7.x-FPM +;; PHP-FPM ;; Global FPM configuration. -;; This file override /etc/php/7.x/fpm/php-fpm.conf -;; It must be loaded after /etc/php/7.x/fpm/php-fpm.conf +;; This file override /etc/php/8.x/fpm/php-fpm.conf +;; It must be loaded after /etc/php/8.x/fpm/php-fpm.conf ;; ;; @context FPM -;; @author Olivier Jullien ;; ----------------------------------------------------- [global] @@ -15,9 +14,10 @@ ; into a local file. ; Note: the default prefix is /var ; Default Value: log/php-fpm.log -error_log = /var/log/php7.0/php7-fpm.log +error_log = /var/log/php/php-fpm.log ; Log level ; Possible Values: alert, error, warning, notice, debug ; Default Value: notice log_level = warning + diff --git a/src/fpm/conf-available/20-domain_01.tld.conf b/src/fpm/conf-available/20-domain_01.tld.conf index 9445900..bc06f16 100644 --- a/src/fpm/conf-available/20-domain_01.tld.conf +++ b/src/fpm/conf-available/20-domain_01.tld.conf @@ -1,9 +1,8 @@ ;; ----------------------------------------------------- -;; PHP 7.x-FPM +;; PHP-FPM ;; domain_01.tld pool configuration. ;; ;; @context FPM POOL -;; @author Olivier Jullien ;; ----------------------------------------------------- ; Start a new pool named 'domain_01.tld'. @@ -30,7 +29,7 @@ group = domain_01.tld listen = /run/php/$pool.sock ; Include common conf settings -include=/etc/php/7.4/fpm/conf-available/common.conf +include=/etc/php/8.0/fpm/conf-available/common.conf ; The number of child processes to be created when pm is set to 'static' and the ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. diff --git a/src/fpm/conf-available/20-domain_02.tld.conf b/src/fpm/conf-available/20-domain_02.tld.conf index 268bf56..7a0df4d 100644 --- a/src/fpm/conf-available/20-domain_02.tld.conf +++ b/src/fpm/conf-available/20-domain_02.tld.conf @@ -1,9 +1,8 @@ ;; ----------------------------------------------------- -;; PHP 7.x-FPM +;; PHP-FPM ;; domain_02.tld pool configuration. ;; ;; @context FPM POOL -;; @author Olivier Jullien ;; ----------------------------------------------------- ; Start a new pool named 'domain_02.tld'. @@ -30,7 +29,7 @@ group = domain_02.tld listen = /run/php/$pool.sock ; Include common conf settings -include=/etc/php/7.4/fpm/conf-available/common.conf +include=/etc/php/8.0/fpm/conf-available/common.conf ; The number of child processes to be created when pm is set to 'static' and the ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. diff --git a/src/fpm/conf-available/common.conf b/src/fpm/conf-available/common.conf index 8531dde..375a467 100644 --- a/src/fpm/conf-available/common.conf +++ b/src/fpm/conf-available/common.conf @@ -1,9 +1,8 @@ ;; ----------------------------------------------------- -;; PHP 7.x-FPM +;; PHP-FPM ;; Common FPM POOL configuration. ;; ;; @context FPM POOL -;; @author Olivier Jullien ;; ----------------------------------------------------- ; the variable $pool can be used in any directive and will be replaced by the @@ -201,7 +200,7 @@ pm.max_requests = 500 ; last request memory: 0 ; ; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php/7.4/fpm/status.html +; It's available in: /usr/share/php/8.0/fpm/status.html ; ; Note: The value must start with a leading slash (/). The value can be ; anything, but it may not be a good idea to use the .php extension or it @@ -228,7 +227,7 @@ pm.max_requests = 500 ; The access log file ; Default: not set -access.log = /var/log/php7.0/$pool.access.log +access.log = /var/log/php/$pool.access.log ; The access log format. ; The following syntax is allowed @@ -292,7 +291,7 @@ access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" ; The log file for slow requests ; Default Value: not set ; Note: slowlog is mandatory if request_slowlog_timeout is set -slowlog = /var/log/php7.0/$pool.log.slow +slowlog = /var/log/php/$pool.log.slow ; The timeout for serving a single request after which a PHP backtrace will be ; dumped to the 'slowlog' file. A value of '0s' means 'off'. diff --git a/src/fpm/conf-available/www.conf b/src/fpm/conf-available/www.conf index 3528376..e21e615 100644 --- a/src/fpm/conf-available/www.conf +++ b/src/fpm/conf-available/www.conf @@ -33,7 +33,7 @@ group = www-data ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /run/php/php7.4-fpm.sock +listen = /run/php/php8.0-fpm.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) @@ -41,7 +41,8 @@ listen = /run/php/php7.4-fpm.sock ; Set permissions for unix socket, if one is used. In Linux, read/write ; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. +; BSD-derived systems allow connections regardless of permissions. The owner +; and group can be specified either by name or by their numeric IDs. ; Default Values: user and group are set as the running user ; mode is set to 0660 listen.owner = www-data @@ -70,7 +71,7 @@ listen.group = www-data ; process.priority = -19 ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user -; or group is differrent than the master process user. It allows to create process +; or group is different than the master process user. It allows to create process ; core dump and ptrace the process for the pool user. ; Default Value: no ; process.dumpable = yes @@ -139,7 +140,7 @@ pm.max_spare_servers = 3 ;pm.max_requests = 500 ; The URI to view the FPM status page. If this value is not set, no URI will be -; recognized as a status page. It shows the following informations: +; recognized as a status page. It shows the following information: ; pool - the name of the pool; ; process manager - static, dynamic or ondemand; ; start time - the date and time FPM has started; @@ -229,7 +230,7 @@ pm.max_spare_servers = 3 ; last request memory: 0 ; ; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php/7.4/fpm/status.html +; It's available in: /usr/share/php/8.0/fpm/status.html ; ; Note: The value must start with a leading slash (/). The value can be ; anything, but it may not be a good idea to use the .php extension or it @@ -237,6 +238,22 @@ pm.max_spare_servers = 3 ; Default Value: not set ;pm.status_path = /status +; The address on which to accept FastCGI status request. This creates a new +; invisible pool that can handle requests independently. This is useful +; if the main pool is busy with long running requests because it is still possible +; to get the status before finishing the long running requests. +; +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Default Value: value of the listen option +;pm.status_listen = 127.0.0.1:9001 + ; The ping URI to call the monitoring page of FPM. If this value is not set, no ; URI will be recognized as a ping page. This could be used to test from outside ; that FPM is alive and responding, or to @@ -269,13 +286,13 @@ pm.max_spare_servers = 3 ; %d: time taken to serve the request ; it can accept the following format: ; - %{seconds}d (default) -; - %{miliseconds}d +; - %{milliseconds}d ; - %{mili}d ; - %{microseconds}d ; - %{micro}d ; %e: an environment variable (same as $_ENV or $_SERVER) ; it must be associated with embraces to specify the name of the env -; variable. Some exemples: +; variable. Some examples: ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e ; %f: script filename @@ -374,7 +391,7 @@ pm.max_spare_servers = 3 ; Redirect worker stdout and stderr into main error log. If not set, stdout and ; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page +; Note: on highloaded environment, this can cause some delay in the page ; process time (several ms). ; Default Value: no ;catch_workers_output = yes diff --git a/src/fpm/phpdisconf.sh b/src/fpm/phpdisconf.sh index 27b4704..7a18864 100644 --- a/src/fpm/phpdisconf.sh +++ b/src/fpm/phpdisconf.sh @@ -1,7 +1,7 @@ #!/bin/bash ## ----------------------------------------------------- -## Disable a PHP7.x-FPM pool configuration. +## Disable a PHP-FPM pool configuration. ## ## @author Olivier Jullien ## ----------------------------------------------------- @@ -104,7 +104,7 @@ declare -i iReturn=1 # At least one argument if (($# < 1)) || [[ -z "$1" ]]; then echo "Usage: $(basename "$0") [configuration 2 ...]" - echo -e "\tDisable a PHP7.x-FPM pool configuration file." + echo -e "\tDisable a PHP8.x-FPM pool configuration file." echo -e "\t\tPool configuration file." exit ${iReturn} fi diff --git a/src/fpm/phpenconf.sh b/src/fpm/phpenconf.sh index ce00011..449faf4 100644 --- a/src/fpm/phpenconf.sh +++ b/src/fpm/phpenconf.sh @@ -1,7 +1,7 @@ #!/bin/bash ## ----------------------------------------------------- -## Enable a PHP7.x-FPM pool configuration. +## Enable a PHP-FPM pool configuration. ## ## @author Olivier Jullien ## ----------------------------------------------------- @@ -111,7 +111,7 @@ declare -i iReturn=1 # At least one argument if (($# < 1)) || [[ -z "$1" ]]; then echo "Usage: $(basename "$0") [configuration 2 ...]" - echo -e "\tEnable a PHP7.x-FPM pool configuration file." + echo -e "\tEnable a PHP8.x-FPM pool configuration file." echo -e "\t\tPool configuration file." exit ${iReturn} fi diff --git a/src/mods-available/zzz-dev.ini b/src/mods-available/zzz-dev.ini index 6b7a0ec..080cd0a 100644 --- a/src/mods-available/zzz-dev.ini +++ b/src/mods-available/zzz-dev.ini @@ -1,10 +1,9 @@ ;; ----------------------------------------------------- -;; PHP 7.x-FPM +;; PHP-FPM ;; Global PHP configuration for development. -;; This file override /etc/php/7.x/fpm/php.ini +;; This file override /etc/php/8.x/fpm/php.ini ;; ;; @context PHP -;; @author Olivier Jullien ;; ----------------------------------------------------- [PHP] @@ -13,8 +12,8 @@ error_reporting = E_ALL display_errors = On display_startup_errors = On ignore_repeated_errors = On -error_log = /var/log/php7.0/php7.log -allow_url_fopen = Off +error_log = /var/log/php/php.log +allow_url_fopen = On allow_url_include = Off expose_php = Off max_execution_time = 30 @@ -23,7 +22,8 @@ memory_limit = 128M post_max_size = 8M file_uploads = On upload_max_filesize = 5M -disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,exec,passthru,system,proc_open,parse_ini_file,highlight_file, +;;disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,exec,passthru,system,proc_open,parse_ini_file,highlight_file, +zend.exception_string_param_max_len = 15 [Date] date.timezone = "Europe/Paris" @@ -38,7 +38,7 @@ session.use_cookies = 1 ;session.cookie_secure = session.use_only_cookies = 1 session.cookie_httponly = 1 -session.cookie_samesite = Lax +session.cookie_samesite = Strict session.gc_probability = 1 [opcache] @@ -48,7 +48,10 @@ opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=0 -opcache.error_log=/var/log/php7.0/opcache.log +#opcache.validate_timestamps = 0 +opcache.file_update_protection = 0 +#opcache.save_comments = 0 +opcache.error_log=/var/log/php/opcache.log [mbstring] mbstring.language=neutral @@ -56,71 +59,58 @@ mbstring.detect_order=auto [XDebug] ; General -;xdebug.auto_trace=0 +; Or, on the command line: +; - export XDEBUG_MODE=debug +; - export XDEBUG_CONFIG="client_host=192.168.42.34 log=/tmp/xdebug.log" +; +xdebug.mode=coverage,debug,develop +;off , coverage, debug, develop, gcstats, profile, trace +xdebug.start_with_request=default +;default, yes, no, trigger xdebug.cli_color=1 +;xdebug.client_discovery_header="" +;xdebug.client_host=localhost +;xdebug.client_port=9003 +;xdebug.discover_client_host=0 ;xdebug.collect_assignments=0 -;xdebug.collect_includes=1 -xdebug.collect_params=5 +;xdebug.collect_params=0 xdebug.collect_return=1 -xdebug.collect_vars=1 -xdebug.coverage_enable=1 -;xdebug.default_enable=1 - -;xdebug.extended_info=1 +;xdebug.connect_timeout_ms=200 ;xdebug.file_link_format= ;xdebug.filename_format=...%s%n ;xdebug.force_display_errors=0 ;xdebug.force_error_reporting=0 +;xdebug.gc_stats_output_name = gcstats.%p ;xdebug.halt_level=0 ;xdebug.idekey=*complex* -;xdebug.manual_url=http://www.php.net +;xdebug.log= +xdebug.log_level=3 xdebug.max_nesting_level=100 ;xdebug.max_stack_frames=-1 -;xdebug.overload_var_dump=2 +;xdebug.output_dir=/tmp +;xdebug.profiler_append=0 +;xdebug.profiler_output_name=cachegrind.out.%p ;xdebug.scream=0 ;xdebug.show_error_trace=0 ;xdebug.show_exception_trace=0 ;xdebug.show_local_vars=0 -xdebug.show_mem_delta=1 -;xdebug.var_display_max_children=128 -;xdebug.var_display_max_data=512 -;xdebug.var_display_max_depth=3 - -; Trace -;xdebug.trace_enable_trigger=0 -;xdebug.trace_enable_trigger_value="" +;xdebug.start_upon_error=default ;xdebug.trace_format=0 ;xdebug.trace_options=0 -;xdebug.trace_output_dir=/tmp ;xdebug.trace_output_name=trace.%c - -; Profiling -;xdebug.profiler_aggregate=0 -;xdebug.profiler_append=0 -xdebug.profiler_enable=1 -;xdebug.profiler_enable_trigger=0 -;xdebug.profiler_enable_trigger_value="" -;xdebug.profiler_output_dir=/tmp -;xdebug.profiler_output_name=cachegrind.out.%p - -; Remote -;xdebug.remote_addr_header="" -;xdebug.remote_autostart=0 -;xdebug.remote_connect_back=0 -;xdebug.remote_cookie_expire_time=3600 -xdebug.remote_enable=1 -;xdebug.remote_handler=dbgp -;xdebug.remote_host=localhost -;xdebug.remote_log= -;xdebug.remote_mode=req -;xdebug.remote_port=9000 -;xdebug.remote_timeout=200 +;xdebug.trigger_value="" +;xdebug.var_display_max_children=128 +;xdebug.var_display_max_data=512 +;xdebug.var_display_max_depth=3 ; Dump -xdebug.dump.SERVER=REQUEST_URI,REQUEST_METHOD +xdebug.dump.SERVER=REQUEST_URI,REQUEST_METHOD,REMOTE_ADDR xdebug.dump.POST=* xdebug.dump.GET=* xdebug.dump.SESSION=* -;xdebug.dump_globals=1 -;xdebug.dump_once=1 -;xdebug.dump_undefined=0 +xdebug.dump.COOKIE=* +xdebug.dump.FILES= +xdebug.dump.REQUEST=* +xdebug.dump_globals=1 +xdebug.dump_once=1 +xdebug.dump_undefined=0 diff --git a/src/mods-available/zzz-prod.ini b/src/mods-available/zzz-prod.ini index 334069b..22596a4 100644 --- a/src/mods-available/zzz-prod.ini +++ b/src/mods-available/zzz-prod.ini @@ -1,10 +1,9 @@ ;; ----------------------------------------------------- -;; PHP 7.x-FPM +;; PHP-FPM ;; Global PHP configuration for production. -;; This file override /etc/php/7.x/fpm/php.ini +;; This file override /etc/php/8.x/fpm/php.ini ;; ;; @context PHP -;; @author Olivier Jullien ;; ----------------------------------------------------- [PHP] @@ -13,7 +12,7 @@ error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT display_errors = Off display_startup_errors = Off ignore_repeated_errors = On -error_log = /var/log/php7.0/php7.log +error_log = /var/log/php/php.log allow_url_fopen = Off allow_url_include = Off expose_php = Off @@ -24,6 +23,7 @@ post_max_size = 8M file_uploads = On upload_max_filesize = 5M disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,exec,passthru,system,proc_open,parse_ini_file,highlight_file, +zend.exception_string_param_max_len = 0 [Date] date.timezone = "Europe/Paris" @@ -38,18 +38,79 @@ session.use_cookies = 1 ;session.cookie_secure = session.use_only_cookies = 1 session.cookie_httponly = 1 -session.cookie_samesite = Lax +session.cookie_samesite = Strict session.gc_probability = 1 [opcache] opcache.enable=1 opcache.enable_cli=1 -opcache.memory_consumption=128 +opcache.memory_consumption=512 opcache.interned_strings_buffer=8 -opcache.max_accelerated_files=4000 +opcache.max_accelerated_files=20000 opcache.revalidate_freq=2 -opcache.error_log=/var/log/php7.0/opcache.log +#opcache.validate_timestamps = 0 +opcache.file_update_protection = 0 +#opcache.save_comments = 0 +opcache.error_log=/var/log/php/opcache.log [mbstring] mbstring.language=neutral mbstring.detect_order=auto + +[XDebug] +; General +; Or, on the command line: +; - export XDEBUG_MODE=debug +; - export XDEBUG_CONFIG="client_host=192.168.42.34 log=/tmp/xdebug.log" +; +xdebug.mode=off +;off , coverage, debug, develop, gcstats, profile, trace +xdebug.start_with_request=default +;default, yes, no, trigger +xdebug.cli_color=1 +;xdebug.client_discovery_header="" +;xdebug.client_host=localhost +;xdebug.client_port=9003 +;xdebug.discover_client_host=0 +;xdebug.collect_assignments=0 +;xdebug.collect_params=0 +xdebug.collect_return=1 +;xdebug.connect_timeout_ms=200 +;xdebug.file_link_format= +;xdebug.filename_format=...%s%n +;xdebug.force_display_errors=0 +;xdebug.force_error_reporting=0 +;xdebug.gc_stats_output_name = gcstats.%p +;xdebug.halt_level=0 +;xdebug.idekey=*complex* +;xdebug.log= +xdebug.log_level=3 +xdebug.max_nesting_level=100 +;xdebug.max_stack_frames=-1 +;xdebug.output_dir=/tmp +;xdebug.profiler_append=0 +;xdebug.profiler_output_name=cachegrind.out.%p +;xdebug.scream=0 +;xdebug.show_error_trace=0 +;xdebug.show_exception_trace=0 +;xdebug.show_local_vars=0 +;xdebug.start_upon_error=default +;xdebug.trace_format=0 +;xdebug.trace_options=0 +;xdebug.trace_output_name=trace.%c +;xdebug.trigger_value="" +;xdebug.var_display_max_children=128 +;xdebug.var_display_max_data=512 +;xdebug.var_display_max_depth=3 + +; Dump +xdebug.dump.SERVER=REQUEST_URI,REQUEST_METHOD,REMOTE_ADDR +xdebug.dump.POST=* +xdebug.dump.GET=* +xdebug.dump.SESSION=* +xdebug.dump.COOKIE=* +xdebug.dump.FILES= +xdebug.dump.REQUEST=* +xdebug.dump_globals=1 +xdebug.dump_once=1 +xdebug.dump_undefined=0