Re: http(8) - PHP 8.0.11 - excecute shell command return code 127 (not found)

2021-10-21 Thread J. K.
Hi Stuart!

Sorry, for my late response.

On 19.10.21 13:35, Stuart Henderson wrote:
> 
> You need to provide $CHROOT/bin/sh as well for php's exec() function to work.
> 

Thank you. Solved the issue.
Didn't know that.

Best regards,

J.K.



http(8) - PHP 8.0.11 - excecute shell command return code 127 (not found)

2021-10-19 Thread J. K.
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?

Kind regards,

J. K.




Re: http(8) - PHP 8.0.11 - excecute shell command return code 127 (not found)

2021-10-19 Thread Stuart Henderson
On 2021-10-19, J. K.  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.