Your software
My Mautic version is: 5.0.4
My PHP version is: 8.1.2-1ubuntu2.17
My Database type and version is: MySQL 8.0.36
OS: Ubuntu 22.04
WebServer: Apache/2.4.52
Your problem
My problem is: Upon attempting to install, I get the following message: “The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.”
Steps taken to install:
Attempting to install for first time. I downloaded the zip file directly from Download - Mautic Community, moved the zip file to my web directory: /var/www/html/maut/
Extracted using unzip and accessed the website: 127.0.0.1/maut/
modified apache2.conf for the ‘AllowOverride All’ issue.
These errors are showing in the log:
No logs are being generated in the mautic/var/log directory.
Apache error logs show:
dilbert@tww:/var/www/html/maut$ tail -f /var/log/apache2/error.log
[Tue Jun 04 15:52:58.421009 2024] [php:notice] [pid 1982011] [client 127.0.0.1:54816] PHP Warning - include(/var/www/html/maut/var/cache/prod/middlewares.cache.php): Failed to open stream: No such file or directory - in file /var/www/html/maut/app/middlewares/MiddlewareBuilder.php - at line 66
[Tue Jun 04 15:52:58.421018 2024] [php:warn] [pid 1982011] [client 127.0.0.1:54816] PHP Warning: include(/var/www/html/maut/var/cache/prod/middlewares.cache.php): Failed to open stream: No such file or directory in /var/www/html/maut/app/middlewares/MiddlewareBuilder.php on line 66
[Tue Jun 04 15:52:58.421022 2024] [php:notice] [pid 1982011] [client 127.0.0.1:54816] PHP Warning - include(): Failed opening '/var/www/html/maut/var/cache/prod/middlewares.cache.php' for inclusion (include_path='.:/usr/share/php') - in file /var/www/html/maut/app/middlewares/MiddlewareBuilder.php - at line 66
[Tue Jun 04 15:52:58.421024 2024] [php:warn] [pid 1982011] [client 127.0.0.1:54816] PHP Warning: include(): Failed opening '/var/www/html/maut/var/cache/prod/middlewares.cache.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/maut/app/middlewares/MiddlewareBuilder.php on line 66
[Tue Jun 04 15:52:58.421027 2024] [php:notice] [pid 1982011] [client 127.0.0.1:54816] PHP Warning - foreach() argument must be of type array|object, bool given - in file /var/www/html/maut/app/middlewares/MiddlewareBuilder.php - at line 68
[Tue Jun 04 15:52:58.421029 2024] [php:warn] [pid 1982011] [client 127.0.0.1:54816] PHP Warning: foreach() argument must be of type array|object, bool given in /var/www/html/maut/app/middlewares/MiddlewareBuilder.php on line 68
[Tue Jun 04 15:52:58.446250 2024] [php:notice] [pid 1982011] [client 127.0.0.1:54816] RuntimeException: Unable to create the "cache" directory (/var/www/html/maut/var/cache/prod). - in file /var/www/html/maut/vendor/symfony/http-kernel/Kernel.php - at line 638
[Tue Jun 04 15:54:08.150189 2024] [php:notice] [pid 1982017] [client 127.0.0.1:47950] LogicException: Extension DOM is required. - in file /var/www/html/maut/vendor/symfony/config/Util/XmlUtils.php - at line 50
Steps I have tried to fix the problem:
Reviewed the file: MiddlewareBuilder.php
lines 20-25:
public function __construct(\AppKernel $app)
{
$this->app = $app;
$this->cacheFile = sprintf('%s/middlewares.cache.php', $app->getCacheDir());
$this->specs = new \SplPriorityQueue();
}
Line 63 - 71:
private function loadCacheFile(): void
{
/** @var array $middlewares */
$middlewares = include $this->cacheFile;
foreach ($middlewares as $middleware) {
$this->push($middleware);
}
}
contents of middlewares.cache.php
<?php return array (
0 => 'Mautic\\Middleware\\CORSMiddleware',
1 => 'Mautic\\Middleware\\HSTSMiddleware',
2 => 'Mautic\\Middleware\\CatchExceptionMiddleware',
3 => 'Mautic\\Middleware\\VersionCheckMiddleware',
4 => 'Mautic\\Middleware\\TrustMiddleware',
);
I then followed the steps in this tutorial to see if I missed something:
but still get the same results.
I also downloaded the file twice to see if it was a corruption issue. MD5’s where the same: 809416a6201488e33f1b99173432997c 92 mautic-504.zip