Migrar de modphp a fpm

De Recursos Educativos
Ir a la navegación Ir a la búsqueda

Problema: usas PHP en Apache, y usas el bueno y viejo mod_php, pero quieres ir más allá y pasarte a una arquitectura FastCGI

Aquí dejo mis notas de cuando lo hice. Estamos hablando de 2023 y Debian 11, quizás 12.

a2dismod mpm_worker mpm_prefork
a2enmod proxy_fcgi mpm_prefork setenvif
a2enconf php8.2-fpm
a2dismod php8.2
apt install php-fpm

Integracion con Munin, tomada de Munin FPM

cd /usr/share/munin/plugins/
wget -O php-fpm https://raw.github.com/MorbZ/munin-php-fpm/master/php-fpm.php
chmod +x php-fpm
ln -s /usr/share/munin/plugins/php-fpm /etc/munin/plugins/php-fpm-memory
ln -s /usr/share/munin/plugins/php-fpm /etc/munin/plugins/php-fpm-cpu
ln -s /usr/share/munin/plugins/php-fpm /etc/munin/plugins/php-fpm-count
ln -s /usr/share/munin/plugins/php-fpm /etc/munin/plugins/php-fpm-time
service munin-node restart

Ajustes habituales en el fichero: /etc/php/8.2/fpm/php.ini

memory_limit = 128M
post_max_size = 21M
upload_max_filesize = 20M

Otros ajustes en /etc/php/8.2/fpm/pool.d/www.conf

systemctl restart php8.2-fpm.service