Описание тега shell-exec
The shell_exec() php function provides the ability to run shell commands during the execution of a script. Other similar functions include, exec(), system(), passthru(), and the use of backticks around the command (``). It is important to note that commands executed this way will be run under the same permissions as the user that started the original process (i.e. calling this from a web page processed by Apache will run this under the same user Apache uses, typically httpd).
This functionality becomes handy when the developer wishes to execute a command which no API, library or extension for PHP exists. Example, a script you are developing needs to display the output of the UNIX vmstat
command. PHP does not have visibility into such information, so the use of shell_exec('vmstat');
becomes warranted.
This function can be a security risk and, as such, this function is commonly disabled in shared hosting environments.