Magento ошибка 500

error 500 magento

Server errors are among the most common Magento errors, especially of the Magento 500 variety.  Wrangling up with an HTTP 500 internal server error can eat away at your precious time and resources. In light of that, let’s dive into the most likely causes behind these errors, and the solutions that developers should use to overcome these.  

  • What are Magento 500 Internal Server Errors?
  • Why Does the Magento 500 Error Occur?
  • Possible Fixes for Magento 500 Error
    • Fix the File Permissions
    • Fix Memory Limitations
    • Fix Issues with the .htaccess File
    • Fix Third-party Plugin Issues
    • Disable Magento Maintenance Mode
    • Fix the PHP Version Issue
    • Fix Missing Extensions
    • Check Server Error Logs
    • Run Magento 2 All Commands
  • Concluding Words
  • FAQ’s

What are Magento 500 Internal Server Errors?

The Magento 500 internal server error is a general HTTP status code that can often crop up when you’re deploying or updating the website. This indicates the server is experiencing something wrong.             

Sometimes, the Magento 500 error is quickly fixed by refreshing the page. But when that doesn’t resolve the problem right away, you may have to troubleshoot to fix the issue.

Let’s check out the possible reasons behind this sort of error.

Why Does the Magento 500 Error Occur?

There are 4 potential issues that may cause this error.

  • Permission Issues: When you haven’t set your permissions according to Magento’s strict requirements, this error might happen.
  • Memory Limitation: Magento consumes a lot of resources, and it may be that you don’t have enough memory to handle those resources.
  • Issue in .htaccess file: A Magento store migrated from the localhost to any other server with the wrong configuration can result in Magento internal server error. Magento accesses the .htaccess file first, so any misconfiguration can lead to the server experiencing the Magento 500 error.
  • Third-Party Plugin Issues: The third-party extensions that you install might not be compatible with the server configuration.

Possible Fixes for Magento 500 Error

Before troubleshooting, enable developer mode in Magento 2 to uncover the cause of the error. To do so, run the following command:

php bin/magento deploy:mode:set developer

Here’s how to resolve the Magento 500 error.

Fix the File Permissions

The Magento 2 directory structure contains standard file and folder permissions. But when you install an extension or update to Magento 2 on the server, it changes those permissions. That causes the appearance of the Magento 500 internal server error when logging in to the admin panel. 

To fix this, change the file permissions of index.php in the root file from 664 to 644 through your website’s file manager. Resetting permissions can fix the Magento 500 error. 

Please run the following commands to set the permissions:

find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;
find ./var -type d -exec chmod 777 {} ;
find ./pub/media -type d -exec chmod 777 {} ;
find ./pub/static -type d -exec chmod 777 {} ;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod u+x bin/Magento

Still stuck? Cloudways provides the easiest way to reset the file permissions.

How do you fix the file permissions in Cloudways?

  1. Log in to your Cloudways Platform with your credentials.
  2. From the top menu bar, open Applications.
  3. Choose your desired application.

Magento 500 1 Error file permission fixing

  1. Select Application Settings.

Magento 500 2 application setting

  1.  Scroll down to the General tab to see the option to ‘Reset File/Folders Permissions’. Check the dropdown next to this option to choose the desired user (master or application user).

Magento 500 6 reset permission

  1.  Click to reset the file permissions that you want to set.
  2. Click on “Save Changes”.

Verify the permissions and then refresh the page to check if the 500 error is gone.

Fix Memory Limitations

The 500 Magento internal server error may appear on the product or checkout page of the Magento 2 website  when your server is unable to provide the resources to respond on request. To address this, increase the memory limit in the php.ini file or .htaccess file.

For the .htaccess file, write or change the lines as shown below:

<IfModule mod_php5.c>
php_value memory_limit 256M
</IfModule>
For the php.ini file, add or change the the lines as shown below, based on server health:
memory_limit = 1024M

If you are unable to make these changes due to a lack of permissions on your server, ask the hosting provider to make these changes.

There’s an easier way to fix memory limitations with Cloudways.

How do you fix the memory limit in Cloudways?

  1.  Under Server Management, select Settings & Packages.

Magento 500 7 Setting Packages

  1.  Under the Basic Settings, configure the memory limitation as per need.

Magento 500 3 basic setting

  1. Click “Save Changes”.
  2. Refresh the page again.

Fix Issues with the .htaccess File

To fix a 500 internal server error caused by the wrong configuration in the .htaccess file, try renaming or removing the .htaccess file and reloading the website again to check if the error is fixed.

If the Magento 500 internal server error is fixed, then there is some configuration issue with the .htaccess file that needs to be fixed. Take care to avoid any issues with broken 404 links in your store with this fix.

Fix Third-party Plugin Issues

You might be experiencing the Magento internal server error due to the installation of a third-party extension, or an extension upgrade that enables maintenance mode or creates version compatibility issues after configuration.

To fix this just need to disable the mod by running the following command

php bin/magento mod:disable

Or contact your extension support team to fix it.

Disable Magento Maintenance Mode

The 500 internal server errors can appear during maintenance mode. Developers often enable the maintenance mode to deploy a website to the other server, by putting the “maintenance.flag” file into the root folder and changing the permissions of index.php to 666.

To fix this, disable the maintenance mode by removing the maintenance.flag file or running the following command:

php bin/magento maintenance:disable

After this, change the index.php file permissions to 755, and clear the cache of your Magento 2 store.

Use the command blow to change permissions of index.php:

chmod 775 -R index.php

Fix the PHP Version Issue

Your PHP version might not be compatible with the server configuration. Check the logs to see what compatible version you need based on your requirements and install it.

Try the below command for PHP update version from ssh:

sudo apt update

sudo apt install php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath

How do you fix the PHP version issue in Cloudways?

  1. Under Server Management, select Settings & Packages.

Magento 500 4 basic setting

  1. Under the Packages tab, select the PHP version from dropdown.

Magento 500 5 PHP setting

  1. Click Save Changes.

Fix Missing Extensions

Missing extensions or modules in your server or PHP configuration might be behind your internal 500 server errors. Find out which extension is missing and install it to resolve the error.

Installing CURL Extension

To install and fix the missing CURL extension, use the command below:

Sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

Check Server Error Logs

Check the log files to identify the actual problem.

Fixing Apache Logs

To resolve  missing configuration on your server or invalid commands in a server configuration error, check the web server logs need to be checked.

For Apache, the logs directory:

/var/log/httpd/ -> centos
/var/log/apache2/ -> debian, ubuntu

Directory List of Error Log

The Magento 2 Logger can help you determine which log file you need to debug for the problem. Enabling developer mode to reload the website, and check the error log of the Magento 2 store in the var/log directory.

Run Magento 2 All Commands

The Magento 500 server error could be resolved by running the following lines:

rm -rf generated/*
rm -rf var/*
cd pub/static
rm -r adminhtml
rm -r frontend
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

Concluding Words

Avoid the Magento 500 error by being careful during store maintenance. Make sure you use the right file permissions in the Magento root directory. Make and follow a set of guidelines before upgrading or installing an extension that causes issues. Also Magento 503 error could be the cause for server error too.

If, after following the steps in this article, you’re still unable to resolve this error, contact your hosting provider.

FAQs

What is a 500 internal server error?

The HTTP 500 internal server error is a response code that indicates your server is experiencing trouble.

How can you fix the HTTP error 500 in Magento 2?

Investigate the actual cause behind the error, and implement these solutions one by one:

  • Change Magento File Permissions
  • Fix Memory Limitation
  • Rename or remove .htaccess file
  • Disable Maintenance Mode
  • Fix Missing Extension
  • Fix PHP Version
  • Fix Third Party Extension Issues
  • Check Web Server Error Logs
  • Run All Commands

Share your opinion in the comment section.
COMMENT NOW

Share This Article

Customer Review at

“Great speed, features, knowledgebase, dashboard, UX and fast, expert support. Very happy!”

Stefan [Management Consultant]

Abdur Rahman

Abdur Rahman is the Magento whizz at Cloudways. He is growth ambitious, and aims to learn & share information about Ecommerce & Magento Development through practice and experimentation. He loves to travel and explore new ideas whenever he finds time. Get in touch with him at [email protected]

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

Magento 2 error 500 is common in the hosting environment, which results in hiding PHP errors and then tells visitors to contact the admin system to report the error. If you can’t fix this error soon, it may cause a loss in traffic and directly impact the user experience. 

If this is the first time you faced a 500 error in Magento 2, find an appropriate way to fix it in the post. If you haven’t seen a 500 error in Magento 2 yet, keep reading to get some points that can help you avoid it through the most common causes. 

Before you read, don’t mind if we use different terms like “Magento 2 error 500”, “Magento Internal Server Error 500”, or “Magento HTTP error 500.” We’re just mentioning the error in different ways that many people usually call. 

Don’t miss related solutions in the final lines. 

I – What does it mean by Magento 2 Error 500? 

magento-2-error-505

When you enter an exact URL into the address bar or click a link on a website, you request the server to show you a page. Presently, for some reason, the server can’t return the requested page and notifies you that you are facing an internal server error.

Magento internal server error 500 (Magento 500 error) is a general HTTP status code in which something has gone wrong with the site’s server, but the server could not identify what the exact issue is.

Sometimes, a 500 Internal Server Error may be temporary and will disappear when you refresh/reload the page. If it appears during the checkout process at an online store, don’t be surprised if duplicate attempts to checkout create several orders. Most online merchants have automatic protections against this behavior, but it’s still something to keep in mind.

It’s necessary to check the server error logs to get more information to understand a Magento internal server error 500. Foremost, you need to enable the Developer Mode, which allows you to debug Magento and see detailed exceptions on your error page, not just error messages such as: 

  • There has been an error processing your request
  • Magento exception printing is disabled by default for security reasons
  • Magento 500 Internal Server Error

For Magento 2 users, the Developer Mode will be enabled when you run the following command line in the Magento bootstrap file: 

php bin/magento deploy:mode:set developer

II – The Causes of Magento Internal Server Error 500 

There can be many reasons behind this error. However, a 500 error in Magento 2 can originate from one of these five most common reasons: 

  • Permission issues 
  • Memory limitation 
  • Issues in the .htaccess file 
  • Missing modules
  • Third-party plugin issues

Permission issues 

One of the most common reasons causing Magento 2 error 500 is the misconfigured permissions of the Magento files. People usually face this error while accessing the Magento admin panel or the Magento connect manager. This is because the default permission of the index files after Magento installation will be 664. Some systems won’t accept these permissions and then show this error. 

Memory limitation 

The PHP memory limitation is another common reason that may result in a Magento internal server error 500 after upgrading the data.  Magento is a resource-wasting application, and this error can arise when the server or the user’s account does not provide enough resources to run Magento. 

For example, insufficient memory or low execution time set for the account can often generate problems. Usually, most web hosts set the default memory limit as 20MB, 32MB, 64MB, etc. 

However, it’s not the same in Magento websites. So, a sensible memory allocation is 256MB. Similarly, the default timeout value may be 30sec, 60sec, 90sec, etc. Sometimes, the Magento application takes longer to return the output and ends up with this error.

Issues in the .htaccess file 

Issues in the .htaccess file commonly occur when you try to install some components such as themes, plugins, patches, etc., in Magento. Wrong configurations in the .htaccess file can block the installation of new components. For instance, syntax errors, URL rewrite errors, or typo errors in .htaccess can cause problems.

Missing modules 

Sometimes you may receive Magento 500 errors during Magento installation because the server doesn’t support specific criteria.

Third-party plugin issue 

You can also get the Magento internal server error after installing new plugins or performing upgrades.

III – How to Fix Magento 2 Error 500? 

fix-magento-error-500

Does 500 Error significantly impact your website? 

First of all, the error surely affects the user experience slightly or significantly. It does matter if it disappears right after users reload the page. If not, your online store is likely to lose potential customers and rarely turn back to shopping because of such a bad experience.  

On the other hand, a Magento 2 error 500 can negatively hurt your website’s ranking if it persists for hours. 

For each reason leading to a Magento 2 Error 500, there will be a relevant solution to fix it. 

Change Magento file permission

It’s common to see Magento 500 Internal Server Errors (Magento 500 error) when logging in to the admin panel. To fix it, access the file manager of your Magento website and adjust the permission of the index.php file in root from 664 to 644. 

You should also change the permission of another index.php file located in downloader/index.php to 644.

Increase php_value memory_limit 

Sometimes, the error may appear on a specific page of your websites like Checkout Page or Product Page when your server lacks the resources to run Magento. It’s recommended for a store with around 500 products to have at least 256M for php_memory_limit value. There’s no difficulty in checking this value via the .htaccess file or php.ini file. 

For the .htaccess file, add the following lines:

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

For the php.ini file, please add/change the following line:

memory_limit = 256M

Because of the lack of permission on hosting, you might not do it yourself, so ask for help from your hosting provider, or you can select a hosting from this list of best optimized Magento hosting to avoid a lack of resources. 

Rename/remove .htaccess file

If you suspect that issues in the .htaccess file caused the Magento 2 Error 500 on your website, try renaming the .htaccess file to check if the error is fixed. 

After that, check the error logs in /var/log/httpd or /var/log/apache2. If there are other issues arising, you must recover the configurations. 

Install missed modules 

You can use the default Magento Check (https://yourdomain.com/magento/magento-check.php) to find out if there is any module missing to install them, and the issue will be fixed.

Get support from plugin developers 

If the problem happens because of third-party plugins, use the command “php bin/magento mod:disable” to turn off the mod and contact your plugin developer to ask for support.

This problem isn’t a big deal if you buy extensions from a reliable extension builder like BSS – the company that is named Adobe Bronze Solution Partner.

IV – Detect More Magento 2 Errors and Bottlenecks 

Apart from Magento HTTP error 500, there could be a variety of other issues that can harm your business if your website encounters them. Some can be resolved by tweaking a thing or two, while others can take several days of troubleshooting to be fixed. Consequently, traffic, website ranking, sales, or even your business’s reputation are what may be hurt. 

For that reason, Magento website maintenance is periodically necessary for reviewing your website’s health. 

BSS Commerce’s helped detect paint points for many Magento sites, from the overall to each specific area.

  • FULL-SITE AUDIT: Review Magento sites in 7 aspects in Magento website maintenance checklist, including Core Code Integrity, Code Validation, 3rd-Party Module Code, Usability, JS Console Errors, Speed, Security. 
  • CODE AUDIT: Conduct an overall code analysis for both frontend and backend to figure our coding errors 
  • USABILITY TESTING: Review if the customer experience in your website is smooth and every function works as it should do. 

After the audit process, the Magento 2 error 500 should be fixed as soon as possible before causing more severe issues, especially security issues and usability issues (directly affecting customer experience). If you do not have an in-house developer to fix those, don’t hesitate to reach out to development agencies. The most crucial benefit of hiring agencies is the professional audit and maintenance process. They have experienced with hundreds of projects and can advise you on the best solutions for your case.

Your website is buggy? Get consultation to CHECK and FIX it now! 

Final Words 

As mentioned, Magento 2 error 500/Magento HTTP error 500 is a common error. So, we should not be afraid when seeing this error message. What you need is to avoid messing up, identify the cause and follow an appropriate solution. 

Don’t forget that BSS Commerce can also help you to resolve other issues with our Magento services

BSS Commerce is one of the leading Magento extension providers and web development services globally. With experienced and certified Magento developers, we commit to bringing high-quality products and services to optimize your business effectively. Furthermore, we offer FREE Installation – FREE 1-year Support and FREE Lifetime Update for every Magento extension.

CONTACT NOW to let us know your problems. We are willing to support you every time.

summer-author

Hi there! I’m Summer. I’m a big fan of business, ecommerce, and technology-related topics and now working as a Content Writer at BSS Commerce. It’s such a great experience to share useful pieces of content for those who concern. This generates the motivation for me to read more and write hard.

If you are using Magento 2.2.4. Then first go to Apache log directory and

[Wed May 30 00:58:17.857269 2018] [core:alert] [pid 7184:tid 1244] [client 127.0.0.1:65528] C:/Creation/wamp64/www/m2version/ms-live-version/.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration
[Wed May 30 00:58:42.568180 2018] [core:alert] [pid 7184:tid 1248] [client 127.0.0.1:49165] C:/Creation/wamp64/www/m2version/ms-live-version/.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration
[Wed May 30 00:59:01.667499 2018] [core:alert] [pid 7184:tid 1252] [client 127.0.0.1:49169] C:/Creation/wamp64/www/m2version/ms-live-version/.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration
[Wed May 30 01:00:04.655715 2018] [core:alert] [pid 7184:tid 1272] [client 127.0.0.1:49174] C:/Creation/wamp64/www/m2version/ms-live-version/.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration
[Wed May 30 01:00:35.151803 2018] [core:alert] [pid 7184:tid 1272] [client 127.0.0.1:49201] C:/Creation/wamp64/www/m2version/ms-live-version/.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration

According to the log, the main problem is a .htaccess file. I don’t know the exact reason but following code remove from the .htaccess file is working.

Remove file tag code.

<Files composer.json>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files composer.lock>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files .gitignore>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files .htaccess>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files .htaccess.sample>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files .php_cs.dist>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files .travis.yml>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files CHANGELOG.md>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files COPYING.txt>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files Gruntfile.js>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files LICENSE.txt>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files LICENSE_AFL.txt>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files nginx.conf.sample>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files package.json>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files php.ini.sample>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files README.md>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files auth.json>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>
<Files magento_umask>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>

Note : I don’t know there may problem in future or not. But it’s help me.

Most web hosts provide one click installation for Magento application.

It looks quite easy! But, sometimes, it may behaves weirdly and throws error.

One such error is 500 error during Magento install.

At Bobcares, we help website owners solve such errors as part of our Dedicated Support Services.

Today, let’s discuss the top 5 reasons for this error and how we fix them.

Magento install error 500 – How we identify?

500 internal server error is a generic error code. It means that something has gone wrong, but the server couldn’t identify it. Some of these errors may be temporary and just disappear when you refresh it. If not, it can be a problem on the server side.

So, our Support experts primarily check the server error logs to get some information about this error. Further, to get more information on this error, we enable Developer mode. For example, in Magento 1, we uncomment the following lines in Magento bootstrap file(index.php).

Mage::setIsDeveloperMode(true);
ini_set(‘display_errors’, 1);

Similarly, in Magento 2, we use the below command to enable developer mode.

php bin/magento deploy:mode:set developer

Magento install error 500 – Causes and Fixes

Now, let’s see the major reasons for Magento install error 500 and how our Dedicated Engineers fix them.

1) Permission issues

One of the most common reasons for Magento install error 500 is the inappropriate permissions of the Magento files. Customers usually get 500 internal server error while accessing the Magento admin panel or the Magento connect manager. This is because, the default permission of the index files after Magento installation will be 664. Some systems won’t accept these permissions and throw this error.

Solution

Our Support Engineers assign proper permissions to the Magento files and folders. In cPanel, we change the permissions from Filemanager > Permissions.

magento install error 500

How to change file permissions from cPanel?

Most importantly, we change the permissions of the index.php file in Magento root folder from 664 to 644. In addition to that, we ensure that the permission of the file downloader/index.php is 644. Otherwise, Magento Connect Manager will throw 500 error.

Further, we make sure that the following folders also have appropriate permissions.

app/etc
var
media

In case if we need to change the permission of multiple files, we use custom scripts to change all at once. For example, to change the permission of files and folders to 644 and 755, we use the below scripts.

find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;

Alternatively, we use Magento Cleanup utility(https://yourdomain.com/magento/magento-cleanup.php) to automatically set correct permissions for the Magento installation.

[Are you confused about setting file and folder permission on your Magento application? Our Support Experts can help you here.]

2) Missing modules

Similarly, another common reason is that the hosting server doesn’t support some of the Magento specifications needed to complete the installation. In other words, missing modules or extensions needed for installing Magento can lead to this error.

For example, one of our customers reported the following error during Magento installation.

/home/xxxxx/public_html/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration

When we checked, the Apache module mod_env was not installed on the server that caused the problems. Similarly, another common mistake that we see is missing mod_version Apache module which is required for Magento 2.2 and 2.3. Also, missing Curl extension can throw 500 internal server error.

Solution

Our Support Experts primarily check the server software requirements for the Magento installation. This helps us to identify the missing modules or extensions.

For that, we use the Magento Check tool(https://yourdomain.com/magento/magento-check.php). It identifies the problems that is hindering the Magento installation. And, if we find any missing modules or extensions, we’ll install them on the server.

For example, in cPanel servers, we enable the Apache Modules from EasyApache4 > Apache Modules. Alternatively, we confirm the required modules are loaded from the httpd.conf file.

Moreover, we ensure that Curl extension is installed on the server. For example, on Ubuntu server, we install it using the below command.

apt-get install curl libcurl3 libcurl3-dev php5-curl

[If you suspect missing modules on your server? Our Server Experts can fix it within minutes.]

3) Insufficient resources

Sometimes PHP errors may also lead to 500 internal server error. Magento is a resource hungry application and this error can pop up when the server or the user’s account lacks resources to run Magento. For example, insufficient memory or low execution time set for the account can often create problems.

That is, most of the web hosts set the default memory limit as 20MB, 32MB, 64MB, etc. But, this won’t work for Magento websites. So, a sensible memory allocation is 256MB.

Similarly, the default timeout value may be 30sec, 60sec, 90sec, etc. Sometimes, the Magento application takes longer time to produce the output and terminates with this error.

Solution

In such cases, our Dedicated Engineers tweak the PHP configuration of the domain accordingly. However, the steps to modify the PHP configuration depends on the hosting environment.

For example, in cPanel servers, we change the memory_limit from cPanel > Select PHP version > Switch to PHP options > PHP selector. Similarly, we can increase the max_execution_time and max_input_time from here.

magento install error 500

How to increase memory_limit from cPanel?

However, in some servers we add the PHP directives to the .htaccess file as shown below.

php_value memory_limit 256M
php_value max_execution_time 1800
php_value max_input_time 1800

But, keep in mind that increasing these PHP parameters is a complex process. Because, higher values are always favorable for hackers to run malicious scripts. So, our Server Experts always ensure that the above parameters are tweaked to optimum values.

[Frequent resource outage issues on your account? Click here, our Experts will check this and fix it for you.]

4) Invalid .htaccess entries

This commonly happens when customers try to install a component such as themes, plugins, patches, etc. in Magento. Wrong settings in .htaccess file can block the installation of new components. For example, syntax errors, URL rewrite errors, typo errors, etc. in .htaccess can create problems.

Solution

Firstly, our Support Engineers check whether .htaccess is creating problems by temporary renaming the file. In addition to that, we check the web server error logs(/var/log/httpd or /var/log/apache2) to see if any errors are logged there. If any problems are noted, we locate and correct the misconfiguration.

5) Maintenance mode enabled

Sometimes, users enable Maintenance mode on the Magento application when performing new updates. This stop visitors from accessing the site when it’s being updated. Also, maintenance flag changes the permission of the index.php file to 666 which makes it unable to execute by web browsers.

But, we’ve seen instances where Magento fails to reverse the permissions of the index.php or remove the maintenance.flag. It can be due to resource outages, interruptions, etc. This can further create problems and throws 500 error.

Solution

In such cases, our Support Experts remove the maintenance.flag from Magento’s root folder and restore the permissions of the index.php file. Similarly, on Magento 2, we remove the file var/maintenance.flag to disable the maintenance mode.

[Need an Expert to look into this Magento install error? Click here to get your problem fixed permanently.]

Conclusion

In short, Magento install error 500 can occur due to wrong file permissions, missing server modules and more. Today, we’ve discussed the top 5 reasons for this error and how our Dedicated Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

As any error appearing on any website, Magento 2 internal server error 500 influences your customer experience, traffic, and conversions. Though sometimes it can disappear after you reload the page, you should take steps to eliminate it immediately, so it doesn’t influence your store traffic for hours.

It is one of the most common Magento errors. So before we get to the solution to fix 500 internal server errors in Magento 2, you should know what it is. 

What is Internal Server Error 500 in Magento 2?

Magento internal server error is a general HTTP status code that appears when you follow the correct URL or click on a website link and request a page from the server. Something goes wrong and the server can’t return the requested page and doesn’t know what the issue is. 

Magento 2 Internal Server Error

Since the server doesn’t know anything about the issues and displays only Internal Server Error 500, you should access the server error logs and check for more information about this issue.

And here are the most common reasons for Internal server errors to appear.

Reasons of Magento 2 500 Internal Server Error

Fixing the Internal Server Error in Magento doesn’t take as much as finding the cause of the problem, since there are quite a few reasons why it appears:

  • Permission Issue
  • Memory Limit
  • Missing Modules
  • Issues in .htaccess File
  • Third-party Extension

How to Fix Magento 2 Internal Server Error?

Based on the causes of this issue, there are the following solutions. However, before taking any actions, enable developer mode and uncomment the following line

#ini_set('display_errors', 1);

in the app/bootstrap.php file to easily debug Magento and get the detailed exceptions in the error log.

Solution #1 Change File Permissions

Magento Internal Server issue most commonly appears when you try to access the Magento admin panel or the connect manager while the Magento permission files are not configured correctly.

Default permission of the index files is 664 after Magento installation which should be 644.

To change the default file permissions from 664 to 644, go to the index.php file in the Magento root and run the following commands.

find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;
find ./var -type d -exec chmod 777 {} ;
find ./pub/media -type d -exec chmod 777 {} ;
find ./pub/static -type d -exec chmod 777 {} ;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod u+x bin/magento

Solution #2 Increase Memory Limit

Magento platform requires certain system capabilities to work correctly. This does include certain PHP memory limits. Usually, Magento hosting providers set a default memory limit to e.g. 20MB or 60 MB which is not enough for Magento.  

To fix Magento internal server error 500, you need to increase the php_memory_limit value to 756M in php.ini or .htaccess files.

For that:

  • Log in to your website server using SSH.
  • Find the folder with the php.ini file and open it via the vi editor.
  • Add the following line to it
memory_limit = 756M
  • Or increase it if the value is too low.

Otherwise:

  • Log in to your website server using SSH.
  • Add the following lines to the .htaccess file.
<IfModule mod_php5.c>
php_value memory_limit 256M
</IfModule>

Solution #3 Rename .htaccess File

Configuration of the .htaccess file is also very important since any errors, typos can cause issues, including Magento 2 500 internal server error. Issues in the .hraccess file appear when you install plugins, patches, or themes and require correct configurations.

Try removing or renaming the .htaccess file to see if the issue will be fixed. 

Solutions #4 Disable Third-party Extensions

Internal Server Error in Magento might appear after you install third-party Magento extensions or upgrade some of them. It is usually a conflict between the new extension or version with the existing modules on your store. 

Run the following command to disable the extension: 

 php bin/magento mod:disable VenorName_ModuleName

Once you run it, contact the vendor to get the details and the fix.

Solution #5 Disable Maintenance Mode

When you enable maintenance mode maintenance.flag file is placed in the Magento root folder. This changes the index.php file permission to 666 which web browsers can’t execute. 

Run the following command to remove the maintenance.flag file and change the permission in index.php to 755.

php bin/magento maintenance:disable

These are the main reasons and solutions for the Magento 2 Internal Server Error that are going to help you sort it out.

Sooner or later every Magento developer comes across it while troubleshooting Magento. However, once you read this article, you should be ready to identify the reason and choose one of the above-mentioned solutions.


Does it help or not? Let us know in the comments below.


Mari Skula

Chief of Content & Customer Success Manager

Mari is a content writer and customer care manager with more than 5 years of experience. She is a constant source of stunning content ideas who can’t get enough of the latest content marketing trends. Mari is an avid learner, a bookworm, and a real wit.

People Also Searched For

  • 500 internal server error in magento
  • how to solve 500 internal server error in magento 2
  • magento 500 internal server error
  • magento install 500 internal server error
  • 500 internal server error in magento connect
  • magento internal server error 500
  • 500 internal server error magento 2
  • additionally a 500 internal server error magento
  • error 500 internal server error magento
  • error 500 internal server error magento admin

Понравилась статья? Поделить с друзьями:
  • Mafia2 exe ошибка приложения 0xc0000142
  • Mafia2 exe ошибка приложения 0xc0000005
  • Mafia ошибка при запуске приложения 0xc0000142
  • Mafia ошибка 4214
  • Mafia definitive edition ошибка при установке