tech:php-fpm_redhat7_centos7_apache_2.4
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:php-fpm_redhat7_centos7_apache_2.4 [2025/06/02 15:24] – Jean-Baptiste | tech:php-fpm_redhat7_centos7_apache_2.4 [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # PHP-FPM RedHat7 CentOS7 Apache 2.4 | ||
| + | |||
| + | Avant de passer en PHP-FPM nous avions ✈ : | ||
| + | |||
| + | `/ | ||
| + | ~~~apache | ||
| + | # | ||
| + | # Cause the PHP interpreter to handle files with a .php extension. | ||
| + | # | ||
| + | < | ||
| + | SetHandler application/ | ||
| + | </ | ||
| + | |||
| + | # | ||
| + | # Allow php to handle Multiviews | ||
| + | # | ||
| + | AddType text/html .php | ||
| + | |||
| + | # | ||
| + | # Add index.php to the list of files that will be served as directory | ||
| + | # indexes. | ||
| + | # | ||
| + | DirectoryIndex index.php | ||
| + | |||
| + | # | ||
| + | # Uncomment the following lines to allow PHP to pretty-print .phps | ||
| + | # files as PHP source code: | ||
| + | # | ||
| + | #< | ||
| + | # SetHandler application/ | ||
| + | #</ | ||
| + | |||
| + | # | ||
| + | # Apache specific PHP configuration options | ||
| + | # those can be override in each configured vhost | ||
| + | # | ||
| + | php_value session.save_handler " | ||
| + | php_value session.save_path | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | yum remove php | ||
| + | rm / | ||
| + | yum install php-fpm | ||
| + | ~~~ | ||
| + | |||
| + | Avec FPM | ||
| + | |||
| + | `/ | ||
| + | ~~~apache | ||
| + | # | ||
| + | # PHP-FPM avec le compte php-monsiteweb (car 127.0.0.1: | ||
| + | # | ||
| + | < | ||
| + | #SetHandler application/ | ||
| + | |||
| + | # 2.4.10+ can proxy to unix socket | ||
| + | # SetHandler " | ||
| + | |||
| + | # Else we can just use a tcp socket: | ||
| + | SetHandler " | ||
| + | </ | ||
| + | |||
| + | # | ||
| + | # Allow php to handle Multiviews | ||
| + | # | ||
| + | AddType text/html .php | ||
| + | |||
| + | # | ||
| + | # Add index.php to the list of files that will be served as directory | ||
| + | # indexes. | ||
| + | # | ||
| + | DirectoryIndex index.php | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [monsiteweb] | ||
| + | #listen = / | ||
| + | listen = 127.0.0.1: | ||
| + | |||
| + | listen.allowed_clients = 127.0.0.1 | ||
| + | |||
| + | user = php-monsiteweb | ||
| + | group = php-monsiteweb | ||
| + | |||
| + | #pm = dynamic | ||
| + | pm = ondemand | ||
| + | pm.max_children = 50 | ||
| + | pm.start_servers = 5 | ||
| + | pm.min_spare_servers = 5 | ||
| + | pm.max_spare_servers = 35 | ||
| + | |||
| + | # Pour debug | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | #slowlog = / | ||
| + | |||
| + | php_admin_value[error_log] = / | ||
| + | |||
| + | php_value[session.save_handler] = files | ||
| + | # Doit être accessible en écriture par l' | ||
| + | php_value[session.save_path] = / | ||
| + | |||
| + | php_value[date.timezone] = " | ||
| + | |||
| + | # A ajuster | ||
| + | php_value[memory_limit] = 64M | ||
| + | php_value[post_max_size] = 10M | ||
| + | php_value[max_execution_time] = 60 | ||
| + | php_value[max_input_time] = 60 | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | adduser --system --home / | ||
| + | mkdir / | ||
| + | chown -R php-monsiteweb: | ||
| + | systemctl enable php-fpm.service | ||
| + | systemctl restart php-fpm.service | ||
| + | systemctl status php-fpm.service | ||
| + | ~~~ | ||
| + | |||
