0

When running:

root@ubuntu:/var/www/Magento2# bin/magento setup:static-content:deploy

I got

-bash: bin/magento: Permission denied

please note that I'm running the command using root user

Ashish Raj
1,3752 gold badges15 silver badges32 bronze badges
asked Feb 23, 2016 at 10:45
3
  • What is the output of ls -l bin/magento? Commented Feb 23, 2016 at 12:14
  • Please provide execute permission to for it even for ROOT user. chmod -x bin/magento Commented Feb 23, 2016 at 12:21
  • use like php bin/magento setup:static-content:deploy The php need to be added before bin/magento Commented Jan 2, 2018 at 6:45

4 Answers 4

1

You can also try php bin/magento setup:static-content:deploy

answered Apr 12, 2017 at 5:39
0

Use word php before the command

php bin/magento setup:static-content:deploy

Refer : Devdocs : static contents

answered Apr 12, 2017 at 5:46
0

As already mentioned in the comments:

Check the permission of the file like so:

ls -lah bin/magento

You will see that the execute permissions are missing. Therefore add the execute permissions like so:

chmod +x bin/magento

If you don't want to allow execution for that script, you can run the script with your local php installation like so:

php bin/magento ...

Nevertheless you should not run any command as root.

answered Nov 21, 2017 at 19:07
0

In order to fix permissions, you can run all of these commands, or at least the last two since it is not mentioned that you've configured permissions on app/:

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
answered Jun 2, 2019 at 8:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.