0

I'm using Ubuntu 16.04 and installed magento 2 on it. When I'm deploying magento 2 site with

Php magento setup:upgrade
Php magento setup:static-content:deploy

I'm getting file permissions errors and HTTP 500 error.

Can anyone help me to solve this issue?

Thanks in advance.

1

First option

You must execute the command from the owner of the web, if for example the user of the web server is "www" you must execute these commands with this user and not with root.

Second option

Another option would be, after generating them, change pub static permissions with the command:

chown -R [USER WWW] pub/static/*
chgrp -R [GROUP WWW] pub/static/*

You must change [USER WWWW] and [GROUP WWW] for the values ​​of your server environment.

Another possible option of error:

Verify that the generic .htaccess exists in /pub/static/

Example

Example

In this case:

  • First option, I need to execute the command with the user "edesarrollo"

  • Second option:

    chown -R edesarrollo pub/static/*

    chgrp -R psacln pub/static/*

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.