I have made a fresh installation of magento 2. Backend was displayed without any css/js format, bacause no file was placed in pub/static/adminhtml/Magento/backend/en_US/ folder.

I tried using php bin/magento setup:static-content:deploy -f and the pub folders got filled with all files. Files have 777 permissions. If I try to access one of them (by url) after I get a 500 error. Administration is still broken and frontend is just a blank page.

What should I do to fix it?

  • Have you compiled? php bin/magento setup:compile – Raül Aug 8 at 8:31
  • Can you check if mod rewrite is enabled or not? – Sukumar Gorai Aug 8 at 8:42
  • @SukumarGorai yes, mod rewrite is enabled – zekia Aug 8 at 9:20
  • @RaülVila I didn't know that compile is necessary, but since you suggest, I tried it, but issue is not solved – zekia Aug 8 at 9:21

Magento2 files & folders permissions are not intended to be such simple to work as it was Magento1, for instance. That 777 try is not a good idea

I'd take a look first at https://devdocs.magento.com/guides/v2.2/install-gde/prereq/file-sys-perms-over.html

Once you are sure that your local environment is correctly configured to host a Magento2 website, I'd repeat this command sequence

bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy

That commands should generate all content the application needs to work in production mode, if permissions are fine

  • I have set permissions, as suggested in this post magento.stackexchange.com/questions/91870/… – zekia Aug 8 at 9:14
  • Is there any reason to bin/magento setup:static-content:deploy since I'm in developer mode? – zekia Aug 8 at 9:15
  • No, if you are in developer mode files should generate on demmand – Raul Sanchez Aug 8 at 9:19
  • About permissions (and username / group ownership) I would strictly follow what devdocs say... that post you have linked is pretty old – Raul Sanchez Aug 8 at 9:21
  • I have checked that all directories suggested are writable. i don' know what else to do – zekia Aug 8 at 9:32

There are few thing that you need to check.

1) Check the symlink (if using windows in etc/di.xml change it to copy). 2) Check the folder permission. like (All directories have 770 permissions.

770 permissions give full control (that is, read/write/execute) to the owner and to the group and no permissions to anyone else.

All files have 660 permissions.

660 permissions mean the owner and the group can read and write but other users have no permissions.) 3) Run the setup:static-content:deploy --area(if areawise). 4) Check the exception log for any less css error(That one also cause this issue) 5) Set your deploy mode to developer to check PHP error for any. 6) And compile the dependencies di:compile.

Try above steps if you still face issues let us know.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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