I installed fresh Magento but there are no styles or js. Files are in pub folder , but if open in browser I'm getting Internal Server Error. Please help. This is localhost, wamp. Thank you! (I tried clear cache and remove directories in var and pub)

enter image description here

I found the answer here: https://magento.stackexchange.com/a/208638/34234


You need to run static content depolyment comment in your server.

Use the following comment

php bin/magento setup:static-content:deploy

Clear cache and set correct folder permission


When Magento 2 is not in production mode, it will try to create symlinks for some static resources on local server. We have to change that behavior of Magento 2 by going to edit ROOT > app > etc > di.xml file. Open up di.xml in your favorite code editor, find the virtualType name="developerMaterialization" section. In that section below, you will find an item which needs to be modified. You can modify it by changing the following content:




Now last step, also delete old files generated in ROOT > pub > static > DELETE ALL EXCEPT .HTACCESS

| improve this answer | |

The 500 status code means that there is an error. Have you tried to look in the network tab how the preview of the response looks like or in a new window or browser tab?

Perhaps you have to enable display_errors first.

Besides that set the deploy mode to developer to get client side static files rendering or deploy the static content

| improve this answer | |

If you are using a cPanel and/or WHM, depending on your settings you may need to remove the .htaccess from the [magento_root]/pub/

| improve this answer | |

I'm using WAMPServer with Apache 2.4. For some reason, Apache on here doesn't recognize <IfVersion. So, in addition to running ./bin/magento setup:static-content:deploy, remove those <IfVersion rules from .htaccess and pub/.htaccess, and that's gotten rid of my 500 errors.

| improve this answer | |

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.