Php-fpm shell_exec usage

Has anyone had success with running shell commands from php-fpm using shell_exec?

I’m attempting to run a program known as ITFlow and have everything up and running so far. The only thing I cannot get functioning is the programs usage of shell commands.

It utilizes whois, dig, and git commands in php scripts using the shell_exec command, however it doesn’t seem to be able to find them even though they are installed.

I tried just adding a simple php file with shell_exec to output the results of “git -h” and when running through php it outputs as expected. When I add this same script to my webserver directory and point my browser to it I get nothing unfortunately.

I figured out the answer, ofc after posting for assistance.

Using the wiki for php-fpm found here a line can be found where the PATH is setup for php-fpm phpEnv."PATH" = lib.makeBinPath [ pkgs.php ];

I just added the required programs to this line, phpEnv."PATH" = lib.makeBinPath [ pkgs.php pkgs.whois pkgs.dig pkgs.git];

1 Like