9

I followed the Magento dev docs per below:

If you add a new .html template, and then edit it, the changes will not apply until you do the following: delete all files in the pub/static/frontend and var/view_preprocessing directories, then reload the pages. You can delete the files manually or run the grunt clean: command in CLI. For details about using Grunt in Magento see Installing and configuring Grunt.

However now in developer mode set via htaccess I get Internal Server Error 500 across site and admin urls. Is that a caching issue if its looking for the cleared files to render?

  • 2
    check your error log. – MagenX Feb 9 '16 at 8:41
  • internal server 500 comes due to file permission, just give 755 to folder and 644 to file – Alam Zaib Apr 21 at 9:49

13 Answers 13

11

in developer mode the files are automatically generated when requested and not found. So this should not be a Problem.

When facing a 500 error the first thing you should do is search for your webserver error log.

When running on apache it can mostly be found in one of these 2 locations:

/var/log/httpd/ -> centos, archlinux ...

/var/log/apache2/ -> debian, ubuntu ...

5

Try to run following command in the magento root

php bin/magento setup:static-content:deploy 
2

On CentOS 7, I disabled the firewall settings with the following command:

$ setenforce 0

and thats it. The problem get resolved. with RHEL 7 and CentOS 7, SELinux makes the system more secured but it poses a whole lot of challenges to Non-Linux folks.

2

Solution: Internal Server Error!! Magento 2.2.2 Very Important !! especially for WAMPserver in windows10

  1. Please make sure that LoadModule version_module modules/mod_version.so is loaded from httpd.conf, This bug cause Internal Server Error of Magento 2.2.2 and if following setting got "#" , pls remove "#"

LoadModule version_module modules/mod_version.so

  1. create a new folder and name it "static" after /pub/ looks like this: http://localhost/magento222/pub/static/ right click the "static" folder and click property to make sure if it is writable.

  2. delete your old mysql database for magento222 and create a new one to make a clean and safe installation.

P.S.: Ver. 2.2.2 is not a stable version.

2

Please check .htaccess first.possibility of module not enabled. Because i faced this issue because of mod_version module so I enabled it from apache and now it's working.

You can check also with replacing your .htaccess file Or renamed it to confirm issue of .htaccess file.

Thank you

  • 1
    i have replace .htaccess file and resolved issue thanks – Sagar Dobariya Mar 19 '18 at 4:35
1
  1. It could also be because of wrong file permissions.
  2. Make sure that you CHMOD to "user":"group" "magento install DIR"
1

I also came across the same situation in morning but thanks to @david answer.

After a bit research of log directory of Apache, I came to know about that apache don't have permission to read app/etc/ folder.

So, after giving permission all working fine.

  • 1
    Please tell me the path . – jafar pinjar Aug 15 '18 at 9:00
  • If you are on Linux environment then it will be usually /var/log/apache2 or /var/log/httpd/ – Deepanshu Jain Sep 16 '18 at 6:59
0

seems need only to index.php

show php errors Show PHP errors

and after can fix

in my case - was permission for dirs

0

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.

0

Struggled for an hour and finally issue got resolved after removing the proxy settings. Whoever facing this issue, check your proxy setting.

0

In my case it is due to ownership issue. I was using ubuntu os so I used following command to correct ownership.

sudo chown -R root:root /var/www/project_name

0

Resolved by giving proper file permissions to magento root folder

0

It is a very sophisticated issue.

Much possible reason can happen for this. Better than going randomly, debug the issue.

if you are using apache2 to go to /var/log/apache2 and you will found error.log, other there you will found a specific reason why this is happening. And solved it by a search over the internet.

Possible Problem:

  • If you copy files and database from existing site and put directoly on the new server then there may some copatibilty issue, for this upload a freash copy and try to install it, you will found what is missing
  • In the new Magento version, there is a special folder called generated. That must be write permission.
  • Another main reason is overall file permission. Be sure var, generated, vendor, app/etc, pub/media & pub/static have proper write access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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