cancel
Showing results for 
Search instead for 
Did you mean: 

500 internal server error

SOLVED

500 internal server error

Hi

 

Trying to run magento 2.2.6 on cpanel

i got 500 Internal Server Error

 

host: godaddy web hosting

 

any solution?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: 500 internal server error

Hello @hussein_alamoodi

 

Try to remove the .htaccess file from your Magento root folder and then try to load your website in the browser.

 

If it doesn't give 500 internal server error after removing the .htaccess file, then there must be some PHP version issue or any server configuration is missing.

If you find my answer useful, Please click Kudos & Accept as Solution.

View solution in original post

21 REPLIES 21

Re: 500 internal server error

Hello @hussein_alamoodi

 

Try to remove the .htaccess file from your Magento root folder and then try to load your website in the browser.

 

If it doesn't give 500 internal server error after removing the .htaccess file, then there must be some PHP version issue or any server configuration is missing.

If you find my answer useful, Please click Kudos & Accept as Solution.

Re: 500 internal server error

Hello @hussein_alamoodi

 

There are 4 ways for you to fix 500 internal server errors in Magento 2

  1. Change file permission

500 internal server errors appear 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.

  1. 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
      1. Rename/remove .htaccess file

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

      1. 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
Manish Mittal
https://www.manishmittal.com/

Re: 500 internal server error

Hello @hussein_alamoodi,

 

Please run below command in magento 2 root directory 

Static content deploy

php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home generated/
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
chmod -Rf 777 pub/ var/
php bin/magento cache:clean

Apply permission

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

--
If my answer is useful, please Accept as Solution & give Kudos

Re: 500 internal server error

ty guys

 

i just found out my php vr. was 7.2

 

and the 2.2.6 maximum support 7.1.99

Re: 500 internal server error

@hussein_alamoodi

 

In my previous reply, I told you that it could be the PHP version issue.

You can mark it as a solution so that it can help others who came to find the answer.

 

 

If you find my answer useful, Please click Kudos & Accept as Solution.

Re: 500 internal server error

i have the same issue , we updated Magento from 2.2.3 to 2.2.6. then the error started, we changed the PHP to 7 from 7.1 but we still have the same issue.

my frustration is that the hosting company for 2 weeks not sure about the issue.

 

is it wise to keep Magento 2.2.6 or downgrade?

is it safe to work on the development site while we trying to solve the issue?

is it wise to download the site on a local server and work on it then upload to the live site when issue resolved?

 

Thanks all

Re: 500 internal server error

Hello @alaa_hussain

 

It might be possible that you have a permission issue in your index.php file.

Run the following command from the root folder of your Magento and then check.

 

chmod 644 -R index.php

You can run the above command using sudo also if required.

sudo chmod 644 -R index.php
If you find my answer useful, Please click Kudos & Accept as Solution.

Re: 500 internal server error

work for me, thanks!

Re: 500 internal server error


@Mayur Bhuva wrote:

Hello @hussein_alamoodi

 

Try to remove the .htaccess file from your Magento root folder and then try to load your website in the browser.

 

If it doesn't give 500 internal server error after removing the .htaccess file, then there must be some PHP version issue or any server configuration is missing.


It works for me this solution!