Afin de récupérer et maintenir des sites web j'ai besoin de pouvoir configurer des "virtualhost" dans apache2 avec des versions de php différentes.
Je suis nouveau sur archlinux et je viens de debian (ubuntu). J'avais pour habitude d'installer tous les packages php-fpm disponible de 5.6 à 7.4, puis de spécifier dans chaque virtualhost la version de php-fpm à utiliser, avec ceci :
Code : Tout sélectionner
<IfModule proxy_fcgi_module>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler "proxy:unix:/run/php/php7.2-fpm.sock|fcgi://localhost"
</FilesMatch>
</IfModule>
Code : Tout sélectionner
update-alternatives --set php /usr/bin/php[5.6|7.0|7.1|7.2|7.3|7.4]
Merci.
Pour le moment, j'ai un apache qui fonctionne bien avec le PHP en vigueur 7.4.7
avec les fichiers de config dans "/etc/php/"
et j'ai bien :
Code : Tout sélectionner
[steve@VISU sites]$ php -v
PHP 7.4.7 (cli) (built: Jun 9 2020 19:37:15) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans
[steve@VISU sites]$ php-fpm -v
PHP 7.4.7 (fpm-fcgi) (built: Jun 9 2020 19:37:15)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans
Code : Tout sélectionner
yay -S php72-fpm
et
Code : Tout sélectionner
[steve@VISU sites]$ php72 -v
PHP 7.2.30 (cli) (built: Jul 1 2020 08:37:44) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Code : Tout sélectionner
[steve@VISU sites]$ sudo systemctl enable php72-fpm.service
Created symlink /etc/systemd/system/multi-user.target.wants/php72-fpm.service → /usr/lib/systemd/system/php72-fpm.service.
[steve@VISU sites]$ sudo systemctl start php72-fpm.service
[steve@VISU sites]$ sudo systemctl status php72-fpm.service
● php72-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php72-fpm.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2020-07-01 14:18:14 CEST; 6s ago
Main PID: 528733 (php-fpm72)
Status: "Ready to handle connections"
Tasks: 3 (limit: 38470)
Memory: 5.4M
CGroup: /system.slice/php72-fpm.service
├─528733 php-fpm: master process (/etc/php72/php-fpm.conf)
├─528734 php-fpm: pool www
└─528735 php-fpm: pool www
juil. 01 14:18:14 VISU systemd[1]: Starting The PHP FastCGI Process Manager...
juil. 01 14:18:14 VISU php-fpm[528733]: [NOTICE] fpm is running, pid 528733
juil. 01 14:18:14 VISU php-fpm[528733]: [NOTICE] ready to handle connections
juil. 01 14:18:14 VISU php-fpm[528733]: [NOTICE] systemd monitor interval set to 10000ms
juil. 01 14:18:14 VISU systemd[1]: Started The PHP FastCGI Process Manager.