Mautic 500 Internal Server Error

In this tutorial, we will resolve Mautic 500 Internal Server Error by changing the permission of the files and directories.

So let’s get started.

Are you getting following error in log file?

mautic.WARNING: PHP Warning – require(/mautic/app/cache/prod/doctrine/orm/Proxies/__CG__MauticCategoryBundleEntityCategory.php): failed to open stream: No such file or directory – in file /mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php – at line 209

There is a strong likelihood that you have problems with the permissions and/or ownership of the files and folders on your Mautic instance.

Why do permissions problems cause errors in Mautic?

Mautic needs access to read and write files in the Mautic directory to enable certain functions and scripts to run. If the permissions are not set correctly, or if the user that is trying to run them does not have the correct access, Mautic will not be able to function and you will see errors in the application and server logs.

Fix the permission-related problems in Mautic

To fix the permission-related problems, we need to execute some command. Access the server using SSH with root user.
Go to cd path/to/mautic.

Reset the file and folder permissions

If your file and folder permissions are incorrect, you can run the following commands to reset them:

# find . -type f -not -perm 644 -exec chmod 644 {} +
# find . -type d -not -perm 644 -exec chmod 755 {} +
# chmod -R g+w app/cache/ app/logs/ app/config/
# chmod -R g+w media/files/ media/images/ translations/
# rm -rf app/cache/*

That’s it.

Leave a Comment

Your email address will not be published. Required fields are marked *

Open chat