1

A working site has spontaneously started giving nicely-formatted 500 errors on both / and /administrator.

I am running Joomla 4.2.8 with php 8.2 on Apache 2.4.56 with MariaDB Ver 15.1 Distrib 10.5.19. The server runs Debian 11 and I have total control of it (and have even tried rebooting). The apt logs show that no packages have been upgraded since the site was last known to work.

(The apache configuration includes some redirects to a static site on the same server. These still work without problems.)

I've set debug to true and error-reporting to Maximum in configuration.php

I've set log_level to debug in php-fpm.conf

I've added ini_set('display_errors','On'); and error_reporting(E_ALL); to index.php (this displayed a few syntax deprecations, which I fixed)

I've set apache's logging to trace3. The relevant output to error.log is

[proxy:debug] [pid 2301349] proxy_util.c(2596): [client xxxx] AH00944: connecting fcgi://localhost/srv/http/joomla/administrator/index.php to localhost:8000
[proxy:debug] [pid 2301349] proxy_util.c(2632): [client xxxx] AH02545: fcgi: has determined UDS as /run/php/php8.2-fpm.sock
[proxy:debug] [pid 2301349] proxy_util.c(2819): [client xxxx] AH00947: connected /srv/http/joomla/administrator/index.php to httpd-UDS:0
[proxy:debug] [pid 2301349] proxy_util.c(3188): AH02823: FCGI: connection established with Unix domain socket /run/php/php8.2-fpm.sock (*:80)
[proxy_fcgi:trace1] [pid 2301349] util_script.c(650): [client xxxx] Status line from script 'index.php': 500 Internal Server Error
[http:trace3] [pid 2301349] http_filters.c(1129): [client xxxx] Response sent with status 500
[Wed Oct 25 15:49:52.150283 2023] [proxy:debug] [pid 2301349] proxy_util.c(2554): AH00943: FCGI: has released connection for (*:80)

Other than that, I've found no useful debugging information in any of the logs. I've spent over an hour on google searching for Joomla 500 without learning anything new.

Can anyone suggest how I might debug this further?

<°}}}>«<

5
  • What is in the php log files? Apache logs indicate an error will be found there. If I had to guess I would say that the error may be from using FCGI rather than php-fpm docs.joomla.org/…
    – Huw Evans
    Oct 25 at 23:08
  • Thanks, Huw. Nothing's been posted to the log file since the problem started. I believe that I'm configured to use php-fpm, which is definitely running (and logging). This is a development system which has worked for six months. There's only three of us have access to it and it stopped working during a couple of weeks where nobody logged in. <°}}}>«<
    – seismofish
    Oct 26 at 9:02
  • That's the issue then? Apache is trying to use FCGI in the logs above
    – Huw Evans
    Oct 26 at 11:36
  • 1
    Thanks again, Huw, but FPM /is/ a FastCGI implementation. FPM stands for FastCGI Process Manager (according to php.net/manual/en/install.fpm.php) so you can't use FPM without using FCGI. The log posted shows FGCI connecting to FPM via the socket socket /run/php/php8.2-fpm.sock. <°}}}>«<
    – seismofish
    Oct 27 at 9:13
  • You are right. My bad.
    – Huw Evans
    Oct 27 at 10:58

1 Answer 1

2

I discovered that I can put die statements in index.php (and any file that it includes) to print strings or the values of variables to the web interface. I inserted such a statement at the top of the file and checked that I could see its output. I then moved the statement further down the file, "stepping into" included files until I reached the point where I got a 500 error rather than my intended output. This technique should isolate the section of code responsible for the problem.

At some point during the process, everything started working properly again. I have no idea why and I'm confident that I didn't change any code. A most unsatisfactory conclusion with no lessons learned.

This debugging technique, however crude, seems worth sharing.

<°}}}>«<

1
  • This method may be crude but it is also a good way to troubleshoot where in a script things are breaking. I myself use this method regularly. Good tip,
    – Terry Carter
    Oct 27 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.