I just got a problem, I'm using the webhook for github ( I wrote one in php ).
The problem, I want to restart my nodejs app with pm2 from my php code something like that :
shell_exec("pm2 restart test");
but my user : www-data (nginx) can't execute it.. When I try it log in as www-data I got this :
Error: EACCES, permission denied '/.pm2' at Error (native) at Object.fs.mkdirSync (fs.js:747:18) at Object.CLI.pm2Init (/usr/local/lib/node_modules/pm2/lib/CLI.js:40:8) at Object. (/usr/local/lib/node_modules/pm2/bin/pm2:21:5) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16)
And I don't want to use "sudo" because it's not really clean, do you have an idea ? Thank you very much by advance :)