Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Your software
My Mautic version is: 45_mautic-449
My PHP version is: PHP 8.0
My Database type and version is: MySQL 8.0
The host is: cPanel/WHM

Hi Everyone,

Failed to load resource: the server responded with a status of 500 (Internal Server Error) at https://mautic.cfored.com

I. Description of the Issue:

When accessing mautic.cfored.com we receive a 502 bad gateway error.

II. Log Results:

  1. NGINX error log:

2023/06/13 16:56:58 [error] 16346#16346: *5279 connect() failed (110: Connection timed out) while connecting to upstream, client: 184.94.197.2, server: mautic.cfored.com, request: “GET /favicon.ico HTTP/1.1”, upstream: “http://10.168.0.5:81/favicon.ico”, host: “mautic.cfored.com”, referrer: “http://mautic.cfored.com/”

  1. And many other errors are logged to the Apache error log. Here are a few for example:

[Tue Jun 13 17:00:41.846015 2023] [cgi:error] [pid 9039] [client 127.0.0.1:52676] AH01215: PHP Warning: foreach() argument must be of type array|object, bool given in /var/www/html/app/middlewares/MiddlewareBuilder.php on line 75: /usr/local/cpanel/cgi-sys/ea-php81, referer: http://34.145.37.45/installer
[Tue Jun 13 17:00:41.855688 2023] [cgi:error] [pid 9039] [client 127.0.0.1:52676] AH01215: PHP Deprecation - rtrim(): Passing null to parameter #1 ($string) of type string is deprecated - in file /var/www/html/app/bundles/CoreBundle/Loader/EnvVars/ElFinderEnvVars.php - at line 11: /usr/local/cpanel/cgi-sys/ea-php81, referer: http://34.145.37.45/installer
[Tue Jun 13 17:00:41.855958 2023] [cgi:error] [pid 9039] [client 127.0.0.1:52676] AH01215: PHP Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/app/bundles/CoreBundle/Loader/EnvVars/ElFinderEnvVars.php on line 11: /usr/local/cpanel/cgi-sys/ea-php81, referer: http://34.145.37.45/installer
[Tue Jun 13 17:00:41.869506 2023] [cgi:error] [pid 9039] [client 127.0.0.1:52676] AH01215: PHP Warning - Undefined variable $inline - in file /var/www/html/offline.php - at line 77: /usr/local/cpanel/cgi-sys/ea-php81, referer: http://34.145.37.45/installer
[Tue Jun 13 17:00:41.869657 2023] [cgi:error] [pid 9039] [client 127.0.0.1:52676] AH01215: PHP Warning: Undefined variable $inline in /var/www/html/offline.php on line 77: /usr/local/cpanel/cgi-sys/ea-php81, referer: http://34.145.37.45/installer
[Tue Jun 13 17:00:41.869883 2023] [cgi:error] [pid 9039] [client 127.0.0.1:52676] AH01215: RuntimeException: Unable to create the “cache” directory (/var/www/html/var/cache/prod). - in file /var/www/html/vendor/symfony/http-kernel/Kernel.php - at line 686: /usr/local/cpanel/cgi-sys/ea-php81, referer: http://34.145.37.45/installer

III. Request for Help

Verify server requirements: Ensure that my server meets the minimum requirements for running Mautic. Check the PHP version, required extensions, and server configurations specified by Mautic’s documentation. See the captured screenshot image and recommend cPanel packages to remove.

IV. Expected Result

Login to http://mautic.cfored.com without the offline error message.

Steps I have tried to fix the problem:
Uninstall Packages.

Thanks,
Team

New install or update?
Please run a php console mautic:asset:generate and php console cache:clear afterwards on the command line.

dirk_s,

New install.

See the results of the CLI command lines:

[admin6@imap ~]$ cd /var/www/html/mautic
jailshell: cd: /var/www/html/mautic: No such file or directory
[admin6@imap ~]$ php bin/console mautic:assets:generate
Could not open input file: bin/console
[admin6@imap ~]$ ls
access-logs etc logs perl5 repositories var
cache imap_cfored_com.csr mail public_ftp ssl www
CforED imap_cfored_com.pem nodejsapp public_html tmp
[admin6@imap ~]$

Regards,
Team

“While reproducing the error, I found the following entries in the Apache error log. The main problem is that directories cannot be created, which causes the rest of the error entries. This is caused by using the CGI PHP handler for PHP 8.0. To correct this, I have installed and enabled the suPHP handler. The following article provides instructions for changing the handler using the MultiPHP Manager tool in WHM. To correct this issue, you can use the EasyApache 4 tool to install the fileinfo extension for PHP 8.0. I have provided the following article with instructions for installing PHP extensions,” Lupe Gomez, Technical Analyst I | cPanel Migrations, cPanel, LLC.

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.