-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Description
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