On Wed, 5 Sep 2007, Johan L wrote:
> Hi,
>
> We are trying to get the PHP exec() function to work in a chrooted Apache
> environment (4.1-stable MP ACPI enabled, PHP 5.1.6).
>
> Even if using a static binary (for example date) in the chrooted directory,
> exec just returns 127.
>
> Everything works fine when running chroot from the command line, eg:
> chroot -u www -g www /var/www date
>
> If we start Apache without chroot (-u) then it works too.
>
> Any suggestion on how to solve this (other than disabling chroot of
> course...)?
>
> /Johan
depending on how you invoke the executable, you might need /bin/sh as
well in the chroot. Please remember that this is a risk.
-Otto