This question already has an answer here:
- Disable some php function on special directory 2 answers
- Turn on shell_exec only for some hosts 3 answers
I am using disable_functions
of PHP to block functions like exec, shell_exec
inside php.ini
. However this affects my entire virtual hosts. I cannot choose some specific virtual host to allow shell_exec
, for example. I searched a lot and it looks like an impossible task without additional extensions (like suhosin
).
So I am wondering: I will block shell_exec
in my php.ini
BUT I will try to "rename" shell_exec
inside php.ini
to another function like my_secret_shell_exec
so only I know the function name and I will assign this function name to do exactly as the shell_exec
.
Is this even possible? I mean, renaming an internal function of PHP to a name that only I know so I can safely use it whenever I need?
</div>