On 8 March 2009 c. 10:13:58 new_guy wrote:
> I compile some c code and link it statically. It's the simple 'hello
> world' program. I name it 'hello' and put it in /var/www/test/
>
> I then try to execute it through php using the shell_exec function
> like so:
>
> $output = shell_exec("/var/www/test/hello");
> echo $output;
>
> I get no output at all. Same program runs fine via shell_exec on other
> Apache PHP setups. Being this is statically linked and ldd shows no
> shared libs (the chroot should not impact it, right?) and the php.ini
> files does not exclude shell_exec from running... what else might be
> wrong?

1. You need shell to run shell_exec().

2. You should specify path _inside_ chroot: "/test/hello".

For "real" exec() and friends see pcntl_* functions.

--
  Best wishes,
    Vadim Zhukov

Reply via email to