Reputation: 309
exec() appears to be enabled on the server (function_exists('exec') returns true, and command is not listed in 'disable_functions' variable) yet we get
Warning: exec() has been disabled for security reasons in ...
Any clues on how to detect this before calling?
EDIT:
It was suhosin blacklist and can be checked with following code
if (extension_loaded('suhosin')) { $suhosin = @ini_get("suhosin.executor.func.blacklist"); ...
Upvotes: 5
Views: 1983
Reputation: 691
I answered this in another question page. Its not before the call, but that shouldn't matter. Here is my answer ;)
// This will check if the function actually works.('permissions, rights, ect ..')
if(@exec('echo EXEC') == 'EXEC'){
echo 'exec works';
}
Upvotes: 0
Reputation: 309
It was suhosin blacklist and can be checked with following code
if (extension_loaded('suhosin')) { $suhosin = @ini_get("suhosin.executor.func.blacklist"); ..
Upvotes: 0