0

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?

Rv Singh
  • 1,617
  • 15
  • 34
zekia
  • 620
  • 3
  • 18
  • 49

2 Answers2

1

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

Raul Sanchez
  • 3,036
  • 3
  • 28
  • 63
  • I have set permissions, as suggested in this post https://magento.stackexchange.com/questions/91870/magento-2-folder-file-permissions – zekia Aug 08 '18 at 09:14
  • Is there any reason to bin/magento setup:static-content:deploy since I'm in developer mode? – zekia Aug 08 '18 at 09:15
  • No, if you are in developer mode files should generate on demmand – Raul Sanchez Aug 08 '18 at 09: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 08 '18 at 09:21
  • I have checked that all directories suggested are writable. i don' know what else to do – zekia Aug 08 '18 at 09:32
  • I can see that pub/static/adminhtml/Magento/backend/en_US/ is empty now. Is that normal for developer mode? – zekia Aug 08 '18 at 09:39
  • It is not enough to be "writable", you should care about webserver username / group attending devdocs specifications, to be sure it can access / generate the files – Raul Sanchez Aug 08 '18 at 10:21
0

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.

Ashish Ranade
  • 379
  • 2
  • 11
  • I have set permissions, as suggested in this post https://magento.stackexchange.com/questions/91870/magento-2-folder-file-permissions – zekia Aug 08 '18 at 09:15