1

We are running a large Magento site (17 store views) with several custom modules installed.

Most of the time the sites are stable and performing well, however, we do get some random issues where the skinning on the sites fail to apply in the frontend and have seen occasions where backend can lose formatting, or even return 500 error.

When these happen, cache cleaning usually solves the problem. Does anyone know of potential causes, and preventative measures?

We are using the in-built caching, rather than Varnish.

3
  • Are you getting 500 backend fetch failed error or something else? Commented Jul 25, 2019 at 14:24
  • It varies. Sometimes we get white page 500. Checking logs have shown this was most recently the result of controller command "setActive()" for menu items being called on boolean. So classes are not loading properly. This is happening without any known action being called by our users (admin or CLI). Another symptom is on the frontend, where all css fails to load. In both cases, clearing cache solves the issue, but would like to know if there is a cause/solution for this. Commented Jul 25, 2019 at 14:49
  • @user3867548 any solutions since im getting the same kind of issues on EE 2.4.0
    – sodhancha
    Commented Jan 19, 2021 at 15:22

1 Answer 1

0

There are many reasons for 500 error. I know 4 reasons and its solution.

1: Change file permission

500 internal server errors appears when logging to admin panel, so to solve it, you need to change permission of index.php file in root from 664 to 644.

Additionally, another index.php file in downloader/index.php should be changed permission to 644 to avoid error when navigating to System> Magento Connect> Magento Connect Manager.

2 : Increase php_value memory_limit

If seeing 500 errors in specific pages like checkout page or product page, it means your server lacks of resource for running Magento. So you need to expand memory for your server.

For .htaccess file: Add lines below:

<IfModule mod_php5.c>
Php_value memory_limit 256M
</IfModule>

For ini file: Add following line and change it:

memory_limit = 256M

3 : Rename/remove .htaccess file

Wrong settings in .htaccess file can cause error. In this case, you should try renaming/removing .htaccess file.

4 : Disable maintenance mode

The maintenance mode may cause changing file permission of index.php to 666 and make it appear error as web browsers is able to execute.

Do as follows to disable maintenance mode:

Remove var/.maintenance.flag file
Change php permission to 755
Clear cache

That’s all solution for fixing 500 internal server error in Magento 2. Hopefully all of you can perform.

1
  • Thanks for your suggestion. Unfortunately, none of these are really the cause. Commented Jul 25, 2019 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.