0

Hello yesterday i transfered my store to new server (Ubuntu 18).
After clean installion of Magento i want to run via cli command for the backup but i takes this message
-bash: bin/magento: Permission denied
Any suggest?

3
  • from root of your magento project, run this command sudo chmod -R 0777 bin Commented Sep 16, 2018 at 12:14
  • i get this now Deprecated Functionality: The each() function is deprecated. This message will b e suppressed on further calls in /var/www/vhosts/store/httpdocs/vendor/co linmollenhour/cache-backend-file/File.php on line 81
    – darkattack
    Commented Sep 16, 2018 at 13:11
  • well my php in cli set 7.2 in setting i have 7.0 prntscr.com/kv0aw5 prntscr.com/kv0b5c
    – darkattack
    Commented Sep 16, 2018 at 13:11

1 Answer 1

1

As the comment above suggests, it sounds like the permissions aren't set correctly or the ownership is wrong.

To make sure the files are owned by the correct user, cd into the magento root directory and run chown youruser:youruser . -R

For file and directory permissions, from the magento root directory you can run the following;

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento

4
  • worked!!! but i get this now Deprecated Functionality: The each() function is deprecated. This message will b e suppressed on further calls in /var/www/vhosts/store/httpdocs/vendor/co linmollenhour/cache-backend-file/File.php on line 81
    – darkattack
    Commented Sep 16, 2018 at 13:04
  • well my php in cli set 7.2 in setting i have 7.0 prntscr.com/kv0aw5 prntscr.com/kv0b5c
    – darkattack
    Commented Sep 16, 2018 at 13:11
  • btw after this find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento blank page i got frontend and backend too
    – darkattack
    Commented Sep 16, 2018 at 17:05
  • @darkattack if this worked can you accept the answer? Also if you're having a whitescreen - try running php bin/magento deploy:mode:set developer to get better error reporting on the frontend. Commented Sep 17, 2018 at 16:10

Your Answer

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

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