On 2021-10-19, J. K. <openbsd.l...@krottmayer.com> wrote: > Hi, > > I'm played around with the exec() command from > PHP for the purpose of education. Don't use > these feature in production, to avoid security > issues. > > In the default configuration from OpenBSD, PHP > is inside chroot, so I linked a simple > Hello World program static and placed it in > the root directory from the PHP script. > > But always get code 127, when I try to execute > the binary within PHP. I also checked the file > permissions, which are 755. > > Also tried to place the program in the > /var/www/bin folder. But with the same result. > > Is this function disabled or will be blocked > by the kernel?
You need to provide $CHROOT/bin/sh as well for php's exec() function to work. -- Please keep replies on the mailing list.