Site offline error during installation

Your software
My Mautic version is: 2.16.0
My PHP version is: 7.2

Your problem
My problem is:
Installation of Mautic has 3 stages.
After completing stage 2 (creating an admin account) a site offline error appears that has the following message:

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.

These errors are showing in the log:
[02-Mar-2020 11:49:35 UTC] PHP Warning: require(/<>/app/cache/prod/doctrine/orm/Proxies/__CG__MauticUserBundleEntityRole.php): failed to open stream: No such file or directory in /<>/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209
[02-Mar-2020 11:49:35 UTC] PHP Warning: require(/<>/app/cache/prod/doctrine/orm/Proxies/__CG__MauticUserBundleEntityRole.php): failed to open stream: No such file or directory in /<>/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209
[02-Mar-2020 11:49:35 UTC] PHP Fatal error: require(): Failed opening required ‘<>/app/cache/prod/doctrine/orm/Proxies/__CG__MauticUserBundleEntityRole.php’ (include_path=’.:/opt/alt/php72/usr/share/pear’) in /<>/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209

Steps I have tried to fix the problem:
This thread says to increase memory in php.ini. Tried it, but it didn’t work.
This thread says to ensure the database password doesn’t have any special characters. Tried that, but it still doesn’t work.

Adding GH link so it’s connected to the existing bug report

@rcheesley In the thread you linked to, it says that increasing “max_execution_time (in seconds)” from 30 to 240 will fix it.

Where do I make the change?

Also, would using an older version of Mautic work? If so, which version, should I use.

Thanks!

You would change this in the php.ini file that your Mautic instance uses. It depends how you have set up your server as to which file would be the one to change.

You can find this by:

create a file called info.php that contains <?php phpinfo(); in the webroot (where Mautic is located), and run it in your browser (this is what you’d get in Mautic under System Info).

using the command (at command line)
php -i|grep 'php.ini'

A quick reference to where I explained the difference between local and master settings in case you need it: Asset size wont' change

1 Like

I am using a shared hosting set up (Lunarpages which is now a part of Hostpapa) and I don’t have the option of a command line.

I am using a clean install of Mautic and there is no php.ini file anywhere, so should I create one in root?

Earlier, I create a php.ini file in the root directory and then put the following text inside of it: memory_limit 120M. However, it did not fix anything.

I recommend speaking to your hosting provider and asking them to increase it for you.

We generally recommend a small VPS over shared hosting for this reason, as often resources will be limited which can impair performance and prevent scripts from running properly.

Sometimes, a 500 error during installation can be caused by permissions issues.

Make certain that the Mautic directory is owned by the web server user.
Typically not as much of a concern with shared hosting, but with VPS it is absolutely crucial to have the Mautic directory owned by apache, www-data, or nginx - as the case may be.

On a VPS you can determine which user is running your web server process using the ps -ef | grep apache command (for Apache) or ps -ef | grep nginx (for Nginx).

When PHP-FPM rather than mod_php, also make sure that the php-fpm process is running as the identical user with ps -ef | grep php. Nginx always uses PHP-FPM, whereas Apache can use either mod_php (running in the same process) or PHP-FPM.

If not, the user and group that PHP runs as should be corrected in /etc/php-fpm.d/www.conf.

Then, correct the file and directory ownership recursively with chown -R user:user /path/to/mautic when user:user is the web server user you determined in the previous step and /path/to/mautic is the webroot where you copied the Mautic installation files.

These are the only permission options my hosting gives me.

Screen Shot 2020-03-02 at 22.29.40

Which ones should I select and for which files? Sadly, my hosting doesn’t have any command line options.
Thanks for any advice you can give.

Regarding shared hosting: My host actually had Mautic as a Softaculous auto install option and I used it several times to install Mautic without any issues. They removed that option last month, but all the Mautic installations I had done worked fine (I didn’t realize that they had removed it, and so deleted my existing Mautic installations wanting to start afresh. I wish I had noticed, as I would have kept the existing installation).

I got my host to increase the memory and the time out.

However, I still have the same problem when installing.
Here are the logs:

[03-Mar-2020 14:15:46 UTC] PHP Warning:  require(/<ROOT_PATH>/app/cache/prod/doctrine/orm/Proxies/__CG__MauticUserBundleEntityRole.php): failed to open stream: No such file or directory in /<ROOT_PATH>/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209
[03-Mar-2020 14:15:46 UTC] PHP Warning:  require(/<ROOT_PATH>/app/cache/prod/doctrine/orm/Proxies/__CG__MauticUserBundleEntityRole.php): failed to open stream: No such file or directory in /<ROOT_PATH>/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209
[03-Mar-2020 14:15:46 UTC] PHP Fatal error:  require(): Failed opening required '/<ROOT_PATH>/app/cache/prod/doctrine/orm/Proxies/__CG__MauticUserBundleEntityRole.php' (include_path='.:/opt/alt/php72/usr/share/pear') in /<ROOT_PATH>/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209

It looks like something is missing. Any ideas?

In the end my host fixed it for me. So if you have this problem, try contacting your host. You would be surprised, they might be able to fix it for you.