Mistake: Debian 11 still has php 7.4.33 as default. 8.x can only be installed with an additional PHP repository.
I removed all php to avoid confusion between standard and Sury php. Then I reinstalled from Sury php 8. 0.x and php 8.1.x. I run and see:
systemctl restart liveconfig; liveconfig --diag
Running OS diagnostics... (LiveConfig 2.16.0-release)
....
Running Lua diagnostics...
[WARNING] addPHP: incomplete FPM configuration for '/usr/sbin/php-fpm8.0' - skipping...
[WARNING] addPHP: incomplete FPM configuration for '/usr/sbin/php-fpm8.1' - skipping...
The warnings were for the missing ['fpm']['reload'] which I had commented out. I included it and corrected eol year:
-- register additional PHP interpreter with LiveConfig
LC.web.addPHP( {
['id'] = 'php8',
['cli'] = '/usr/bin/php8.0',
['cgi'] = '/usr/bin/php-cgi8.0',
['fpm'] = {
['bin'] = '/usr/sbin/php-fpm8.0',
['start'] = 'systemctl start php8.0-fpm',
['stop'] = 'systemctl stop php8.0-fpm',
['reload'] = 'systemctl restart php8.0-fpm',
['pool'] = '/etc/php/8.0/fpm/pool.d',
['sockets'] = '/run/php80-fpm'
},
['eol-date'] = '2023-09-26'
} )
Alles anzeigen
After Switching to FPM the affected site shows me this message when I access the site with my browser:
Zitat von php page with <?php phpinfo() ?>
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
In apache's configuration I see:
<IfModule mod_proxy_fcgi.c>
<FilesMatch ".+\.ph(p[3457]?|t|tml|ps)$">
SetHandler "proxy:unix:/run/php80-fpm/<subscription-name>.sock|fcgi://localhost"
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
</FilesMatch>
</IfModule>
The run folder however does not exist, only /run/php. I finally made the socket folder common for all and in /run/php :
-- register additional PHP interpreter with LiveConfig
LC.web.addPHP( {
['id'] = 'php8',
['cli'] = '/usr/bin/php8.0',
['cgi'] = '/usr/bin/php-cgi8.0',
['fpm'] = {
['bin'] = '/usr/sbin/php-fpm8.0',
['start'] = 'systemctl start php8.0-fpm',
['stop'] = 'systemctl stop php8.0-fpm',
['reload'] = 'systemctl restart php8.0-fpm',
['pool'] = '/etc/php/8.0/fpm/pool.d',
['sockets'] = '/run/php'
},
['eol-date'] = '2023-09-26'
} )
Alles anzeigen
I am not sure if that will again cause conflicts when switching versions. I experienced these when after switching php version the FPM service complained that a socket (of the previous PHP version) already existed. The old socket under the other PHP version remained active and was apparently not closed when the version change took place. I tried changing from 8.0.x to 8.1.x and sure enough I see it again after restarting:
Zitat von systemctl restart php8.0-fpm; systemctl status php8.0-fpm
sep 06 11:58:00 hostname php-fpm8.0[767720]: [06-Sep-2023 11:58:00] ERROR: Another FPM instance seems to already listen on /run/php/<subscription-name>.sock
sep 06 11:58:00 hostname php-fpm8.0[767720]: [06-Sep-2023 11:58:00] ERROR: FPM initialization failed
After some time it restored itself although I doubt that 8.0.x was still working because initialization failed. This is however a client with their own dedicated server with limited damage when you are aroud to solve it. Aparently a restart like this seems to solve the issue:
systemctl restart php8.{0,1}-fpm.service apache2 mariadb
systemctl status php8.{0,1}-fpm.service apache2 mariadb