I am using PHP-FPM with Nginx on Ubuntu. I am trying to launch a PHP task from a web application.
The following two examples work correctly when I run the files from CLI, but not from Nginx.
exec("notify-send 'Starting master at ".date("h:m:s")."'");
echo exec("/home/rohit/Projects/webapp/console/index.php blast 23");
These two work correctly from both CLI and Nginx.
echo exec("whoami");
echo exec("pwd");
I tried changing the PHP-FPM user from www-data to rohit (my username), but no luck. What am I doing wrong?