Mautic installation console not coming up and default php (index.php) coming while accessing url

Your software
My PHP version is :
[root@nqdrvmpstgmautic mautic]# rpm -qa | grep -i php
php-intl-5.4.16-48.el7.x86_64
php-process-5.4.16-48.el7.x86_64
php-common-5.4.16-48.el7.x86_64
php-gd-5.4.16-48.el7.x86_64
php-cli-5.4.16-48.el7.x86_64
php-xml-5.4.16-48.el7.x86_64
php-mysql-5.4.16-48.el7.x86_64
php-fpm-5.4.16-48.el7.x86_64
php-mcrypt-5.4.16-9.el7.x86_64
php-pdo-5.4.16-48.el7.x86_64
php-imap-5.4.16-9.el7.x86_64
php-mbstring-5.4.16-48.el7.x86_64
[root@nqdrvmpstgmautic mautic]#
My MySQL/MariaDB version is (delete as applicable): MySQL/MariaDB version
[root@nqdrvmpstgmautic mautic]# rpm -qa | grep -i mysql
mysql-community-client-5.7.34-1.el7.x86_64
mysql57-community-release-el7-9.noarch
mysql-community-libs-5.7.34-1.el7.x86_64
mysql-community-common-5.7.34-1.el7.x86_64
php-mysql-5.4.16-48.el7.x86_64
mysql-community-server-5.7.34-1.el7.x86_64
mysql-community-libs-compat-5.7.34-1.el7.x86_64

Updating/Installing Errors
I am (delete as applicable): Installing / Updating
Upgrading/installing via (delete as applicable) : Web / Command Line

These errors are showing in the installer :

These errors are showing in the Mautic log :

These errors are showing in the upgrade_log.txt file (located in the root of your Mautic instance when an upgrade has been attempted - ensure you remove or redact any sensitive data such as domain names in the file path) :

Your problem
My problem is :

while i am accessing the mautic url below page is coming:

<?php /* * @copyright 2014 Mautic Contributors. All rights reserved * @author Mautic * * @link http://mautic.org * * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ define('MAUTIC_ROOT_DIR', __DIR__); // Fix for hosts that do not have date.timezone set, it will be reset based on users settings date_default_timezone_set('UTC'); require_once __DIR__.'/app/autoload.php'; use Mautic\CoreBundle\ErrorHandler\ErrorHandler; use Mautic\Middleware\MiddlewareBuilder; use function Stack\run; ErrorHandler::register('prod'); run((new MiddlewareBuilder(new AppKernel('prod', false)))->resolve()); *Steps I have tried to fix the problem* :

You need to use php 7.2 - 7.4 for Mautic 3.
Joey

Hi,
I have installed the php version 7.4 and now i am getting the below error while browsing the url.

The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.

System administrators, check server logs for errors.

I am getting below messages in the /var/log/httpd/error.log. Also please find the php version which i installed.

[root@nqdrvmpmautic httpd]# rpm -qa | grep -i php
php-sodium-7.4.20-1.el7.remi.x86_64
php-common-7.4.20-1.el7.remi.x86_64
php-pdo-7.4.20-1.el7.remi.x86_64
php-cli-7.4.20-1.el7.remi.x86_64
php-gd-7.4.20-1.el7.remi.x86_64
php-mysqlnd-7.4.20-1.el7.remi.x86_64
php-pecl-mcrypt-1.0.4-1.el7.remi.7.4.x86_64
php-opcache-7.4.20-1.el7.remi.x86_64
php-json-7.4.20-1.el7.remi.x86_64
php-7.4.20-1.el7.remi.x86_64
[root@nqdrvmpmautic httpd]#

areCacheWarmer.php on line 71
[Mon Jun 07 14:58:16.612101 2021] [php7:notice] [pid 15090] [client 192.168.164.17:43535] PHP Warning - file_put_contents(/var/www/html/mautic/var/cache/prod/middlewares.cache.php): failed to open stream: No such file or directory - in file /var/www/html/mautic/app/bundles/CoreBundle/Cache/MiddlewareCacheWarmer.php - at line 84
[Mon Jun 07 14:58:16.612131 2021] [php7:warn] [pid 15090] [client 192.168.164.17:43535] PHP Warning: file_put_contents(/var/www/html/mautic/var/cache/prod/middlewares.cache.php): failed to open stream: No such file or directory in /var/www/html/mautic/app/bundles/CoreBundle/Cache/MiddlewareCacheWarmer.php on line 84
[Mon Jun 07 14:58:16.612182 2021] [php7:notice] [pid 15090] [client 192.168.164.17:43535] PHP Warning - include(/var/www/html/mautic/var/cache/prod/middlewares.cache.php): failed to open stream: No such file or directory - in file /var/www/html/mautic/app/middlewares/MiddlewareBuilder.php - at line 82
[Mon Jun 07 14:58:16.612189 2021] [php7:warn] [pid 15090] [client 192.168.164.17:43535] PHP Warning: include(/var/www/html/mautic/var/cache/prod/middlewares.cache.php): failed to open stream: No such file or directory in /var/www/html/mautic/app/middlewares/MiddlewareBuilder.php on line 82
[Mon Jun 07 14:58:16.612201 2021] [php7:notice] [pid 15090] [client 192.168.164.17:43535] PHP Warning - include(): Failed opening ‘/var/www/html/mautic/var/cache/prod/middlewares.cache.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) - in file /var/www/html/mautic/app/middlewares/MiddlewareBuilder.php - at line 82
[Mon Jun 07 14:58:16.612207 2021] [php7:warn] [pid 15090] [client 192.168.164.17:43535] PHP Warning: include(): Failed opening ‘/var/www/html/mautic/var/cache/prod/middlewares.cache.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/www/html/mautic/app/middlewares/MiddlewareBuilder.php on line 82
[Mon Jun 07 14:58:16.612218 2021] [php7:notice] [pid 15090] [client 192.168.164.17:43535] PHP Warning - Invalid argument supplied for foreach() - in file /var/www/html/mautic/app/middlewares/MiddlewareBuilder.php - at line 84
[Mon Jun 07 14:58:16.612229 2021] [php7:warn] [pid 15090] [client 192.168.164.17:43535] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/mautic/app/middlewares/MiddlewareBuilder.php on line 84
[Mon Jun 07 14:58:16.616848 2021] [php7:notice] [pid 15090] [client 192.168.164.17:43535] RuntimeException: Unable to create the “cache” directory (/var/www/html/mautic/var/cache/prod). - in file /var/www/html/mautic/vendor/symfony/http-kernel/Kernel.php - at line 765
[root@nqdrvmpmautic httpd]#

Please make sure the files are writable (ownership) by the web server user.
It seems, that your app (or nginx) is trying to write into the cache folder, but there is no permission.

I have provided apache:apache permission recursively to the mautic folder under /var/www/html.
I am using httpd as web server. Still i am getitng above error.

Okay, is the folder writable? 755

Hi,
Yes, I have provided chmod -R 775 mautic.

Try running the cache:clear command or delete the contents of the var/cache/prod folder

Hi,

i can’t see anything on the folder below: Also can you please let me know how to run the cache:clear command is this with mautic url like http://mautic-stg.test.com:cache:clear
[root@nqdrvmpmautic cache]# pwd
/var/www/html/mautic/var/cache
[root@nqdrvmpmautic cache]# ls -ltr
total 0
[root@nqdrvmpmautic cache]#

I am getting below messages in my httpd logs:
[Tue Jun 08 18:16:55.366245 2021] [php7:notice] [pid 1492] [client 192.168.164.17:16540] RuntimeException: Extension DOM is required. - in file /var/www/html/mautic/vendor/symfony/config/Util/XmlUtils.php - at line 50
[Tue Jun 08 18:16:55.726822 2021] [php7:notice] [pid 10684] [client 192.168.164.17:16541] RuntimeException: Extension DOM is required. - in file /var/www/html/mautic/vendor/symfony/config/Util/XmlUtils.php - at line 50
[Tue Jun 08 18:17:08.111499 2021] [php7:notice] [pid 10683] [client 192.168.164.17:16543] RuntimeException: Extension DOM is required. - in file /var/www/html/mautic/vendor/symfony/config/Util/XmlUtils.php - at line 50

I have installed php7.4-xml to resolve the error. Now its working fine