PHP-FPM exec(whoami) no output?
Hi guys,
On my domain, I wanted to know who the script runs as so I used echo exec('whoami') as a test and sure enough it returned the account name (as expected).
However, once I turned on PHP-FPM via MultiPHP Manager, that function no longer returns anything? (literally no output - blank)
If that is normal, can someone explain it to me? Surely it should be running the script as me still if it's using FastCGI?
-
Hello, PHP-FPM executes scripts as the user configured in it's corresponding pool configuration, which defaults to the account username. "exec" is added to the disable_functions PHP configuration option by default with PHP-FPM. That would explain why you are not receiving any output when using that value in the test script. Documentation on PHP-FPM configuration is available at: Configurations Values of PHP-FPM - Documentation - cPanel Documentation Thank you. 0 -
Fantastic, @cPanelMichael! There's no stumping you haha. Thanks yet again!! 0
Please sign in to leave a comment.
Comments
2 comments