[php-src] Issue #13257: PHP Bug when using `shell_exec` on Centos Stream and also 8.
| From: | batata004 | Date: | Fri, 26 Jan 2024 21:16:44 +0000 |
| Subject: | [php-src] Issue #13257: PHP Bug when using `shell_exec` on Centos Stream and also 8. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246350@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13257
Author: batata004
### Description
In my server
selinux is already set to disabled. Also <?php echo
exec('whoami'); ?> returns apache. In my visudo I
already added the line apache ALL=(ALL) NOPASSWD:ALL. So all look fine.
Then I create this test.php file:
<?php echo shell_exec('sudo echo "aa" > /a.txt'); ?>
If I run this using the command line php test.php it all works fine. However if I try
to access domain.com/test.php in the browser (I am using all default configurations
from Apache/PHP, nothing changed) the file never gets created and no error message it shown
anywhere.
I already reported this on SO and after people looking into this, they told me to come here and
report this.
### PHP Version
latest but I think affects all 8 version
### Operating System
Centos stream and 8