Bin/gpm permission denied

hello everyone

i can’t get gpm to work…
i have set the permission for bin/gpm and grav to 774

when i type bin/gpm i get this error message

RuntimeException: Opening file for writing failed on error fopen(/var/www/html/cache/compiled/blueprints/master-localhost.php): failed to open stream: Permission denied in file /var/www/html/vendor/rockettheme/toolbox/File/src/File.php on line 202
Stack trace:

  1. RuntimeException->() /var/www/html/vendor/rockettheme/toolbox/File/src/File.php:202
  2. RocketTheme\Toolbox\File\File->lock() /var/www/html/system/src/Grav/Common/Config/Config.php:262
  3. Grav\Common\Config\Config->loadCompiledBlueprints() /var/www/html/system/src/Grav/Common/Config/Config.php:177
  4. Grav\Common\Config\Config->init() /var/www/html/bin/gpm:41

how can i fix this?

I would check this Permissions section of the Grav docs first. Let me know if you continue to have issues.

already checked this section out and i’m pretty sure i have set it up correctly but i still get the same error.

Well for whatever reason you user (running PHP via bin/gpm) does not have permission to write to the /var/www/html/cache folder, hence the error. Just cd into that folder and check the permissions there. You can also try touch testfile to see if you can create a file in there with your user privs.

I have the same problem. The permissions are set correctly. No problem to create a file in this folder. Any ideas how to fix that?

Host: all-inkl

If you have the same error then you need to ensure the webserver user (whatever account that is) and the regular CLI user you login with, have permission to write to: /var/www/html/cache/compiled/blueprints/ folder.

On shared hosting the webserver tends to run with your account users, so this is not an issue. If you have a setup where your webserver runs as www-data or apache or some other web specific user, you need to ensure that your user is in that group, or all your files are owned by this user. This document should help you out explaining the different scenarios.

If you have control over your server or VPS, I advise running the webserver with the same user that login with to manipulate your files. This can be a new dedicated user.

Hello everybody. I just arrived here because I have the very same issue, trying to install ‘deliver’ theme from SSH with Putty. I tried with root user as well, obtaining the “bin/gpm: Permission denied” message. I hope it helps to describe better the issue.

You get the error immediately after you type bin/gpm something? In this case the bin/gpm file might not be executable. Check that first.