Hi Rolando,
That would be because PHP’s exec function is starting sh as the shell to
execute your command (hence the “sh: “ in the output), and this shell does
not have an environment setup like your current login shell.
Try running env in your login shell and see the output. Then run echo
exec('env'); via your PHP script and see how little there is :)
To fix it try using absolute paths to all programs called via exec - like
/usr/local/bin/pip as opposed to just pip.
Cheers
On 11 February 2015 at 09:50, Rolando Bermúdez Peña <[email protected]>
wrote:
> Hello all,
>
> I have configured supervisor the latest version, to run a php script like
> this:
>
> ...
> command=php /path/to/the/script.php
> ...
>
> But in that script i execute the function exec to run other processes
> within the php script, in the error log that i have configured for that
> program supervisor shows
>
> sh: 1: commandname: not found
>
> commandname is the one that i try to execute using exec within the php
> script.
> And of course the commandname exists and runs fine using the same user
> supervisor uses.
>
> Any ideas of how can get this to work?
> Thanks in advance.
>
> Rolando Bermudez
>
> _______________________________________________
> Supervisor-users mailing list
> [email protected]
> https://lists.supervisord.org/mailman/listinfo/supervisor-users
>
>
_______________________________________________
Supervisor-users mailing list
[email protected]
https://lists.supervisord.org/mailman/listinfo/supervisor-users