Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 10761  / 1 Year ago, fri, february 24, 2023, 4:02:38

Issue


I updated my PHP version from 7.2 to 8.0.5


I followed this guide to update my PHP


I ran this sudo apt-get purge php7.* to remove my php 7 version.


Now when I browse to my website i just get the php codeliek


<?php

/* ton of code here */

when I enable


sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.0-fpm

i get an error of


Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later

when browsing to the website


Edit 1:


[Sat May 22 12:21:03.453315 2021] [proxy:error] [pid 511723] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (*) fai>
[Sat May 22 12:21:03.453398 2021] [proxy_fcgi:error] [pid 511723] [client 102.223.225.133:63119] AH01079: failed to make connection to backend: httpd-UDS

Edit 2:


after running sudo systemctl list-units --failed
i see


● php8.0-fpm.service     loaded failed failed The PHP 8.0 FastCGI Process Manager  

Edit 3:


my apache user is safe-www


Edit 4:


/var/log/apache2/error.log


[Sat May 22 12:33:52.354558 2021] [mpm_prefork:notice] [pid 2763] AH00163: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sat May 22 12:33:52.354654 2021] [core:notice] [pid 2763] AH00094: Command line: '/usr/sbin/apache2'

site.error.log


[Sat May 22 12:33:54.737169 2021] [proxy:error] [pid 2765] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (*) failed
[Sat May 22 12:33:54.737233 2021] [proxy_fcgi:error] [pid 2765] [client 102.223.225.133:63281] AH01079: failed to make connection to backend: httpd-UDS

Edit 5:


/var/log/apache2/error.log


[Sat May 22 12:45:10.817186 2021] [mpm_prefork:notice] [pid 5482] AH00163: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Sat May 22 12:45:10.817273 2021] [core:notice] [pid 5482] AH00094: Command line: '/usr/sbin/apache2

site.error.log


AH01070: Error parsing script headers
[Sat May 22 12:45:13.311597 2021] [proxy_fcgi:error] [pid 5484] (22)Invalid argument: [client 102.223.225.133:63477] AH01075: Error dispatching request to :

Edit 6:


[ - ]  apache-htcacheclean
[ + ] apache2
[ + ] apparmor
[ + ] apport
[ + ] atd
[ + ] chrony
[ - ] console-setup.sh
[ + ] cron
[ - ] cryptdisks
[ - ] cryptdisks-early
[ + ] dbus
[ + ] grub-common
[ - ] hwclock.sh
[ - ] iscsid
[ - ] keyboard-setup.sh
[ + ] kmod
[ - ] lvm2
[ - ] lvm2-lvmpolld
[ + ] multipath-tools
[ - ] open-iscsi
[ - ] open-vm-tools
[ + ] php8.0-fpm
[ - ] plymouth
[ - ] plymouth-log
[ + ] procps
[ - ] rsync
[ + ] rsyslog
[ - ] screen-cleanup
[ + ] ssh
[ + ] udev
[ + ] ufw
[ + ] unattended-upgrades
[ - ] uuidd
[ - ] x11-common

Edit 7:


Solution


More From » 20.04

 Answers
4

If you uninstalled PHP 7.x after installing PHP 8.0, then there was probably a bit of overlap that has taken out your PHP 8.0 installation. A slight re-install might be in order.


Try this:


sudo apt install --reinstall php8.0 libapache2-mod-php8.0
sudo a2enconf php8.0-fpm
sudo service apache2 restart

That will re-load PHP 8.0, ensure the modules are in place and intact, enable the FastCGI Process Manager, then restart Apache. Generally, this is the process that people need to follow when a similar issue happens with PHP7.x.


Following up ...


The AH01079: failed to make connection to backend: httpd-UDS is sometimes caused by a bum service that needs to be restarted. I don't use PHP8.0, so can't guess at the name of the service, but you can list all services running on your system like this:


sudo service --status-all

This will give you a list of services with a [-] to signify it's inactive, and [+] to mean it's running. You will want to look for a service that looks something like php80-php-fpm and restart it:


sudo service php80-php-fpm restart

This may resolve the issue.


If Contending with a Proxy Issue ...


On occasion there may be an issue if using proxy_fcgi and the send buffers do not fill one frame of data. This can be worked around by editing the Apache configuration for the affected site to include this:


<IfModule proxy_module>
ProxyPassMatch ^(.*.php)$ fcgi://127.0.0.1:9000/var/www/html/$1
</IfModule>

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE

# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpeg|jpg|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>

Hopefully this resolves the final issue.


[#1542] Sunday, February 26, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
pantkie

Total Points: 209
Total Questions: 112
Total Answers: 138

Location: Venezuela
Member since Sat, Apr 24, 2021
3 Years ago
pantkie questions
Tue, Feb 14, 23, 07:17, 1 Year ago
Sat, May 8, 21, 05:13, 3 Years ago
Sat, Jun 11, 22, 17:14, 2 Years ago
Thu, Mar 10, 22, 12:32, 2 Years ago
Tue, Oct 25, 22, 05:41, 2 Years ago
;