Martijn van Duren <openbsd+m...@list.imperialat.at> writes:

> You haven't given enough information for a definitive answer, but my
> guess is that you run php through php-fpm, which is by default chrooted
> to /var/www. Since shell_exec and system first call /bin/sh and you
> most likely didn't copy it to /var/www/bin/sh it can't find your shell.
> After that you'd also need to copy the binaries (in this case ls) to
> your chroot and possible library dependencies (not needed for files
> under /bin).
>
> Hope this helps for illustrative purposes, but please don't use it in
> production.
Agree this is likely the problem, unfortunately in PHP-land sometimes
you can't avoid it. For platforms such as Drupal (just to pick an
example I am familiar with) some of the modules will run shell commands
to do things such as send email.

Allan

Reply via email to