Home > Article > Backend Development > How to prohibit execution of commands in php
How to disable command execution in php: first find and open the configuration file php.ini; then find the "disble_function" option; finally modify the content "disble_function=shell_exec, system, passthru" to disable the execution of the command.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
How to prohibit PHP from executing certain system commands ?
Many commands such as shell_exec, system, passthru, popen, etc. are system-related cooperation. If the virtual host is open to users, or if the system permissions are not fully set, it will inevitably Can cause a lot of damage.
To achieve this requirement, just set the disble_function option in php.ini to set instructions that prohibit execution.
Example:
disble_function = phpinfo
If you need multiple instructions, separate them with commas, such as:
disble_function = shell_exec, system, passthru, popen
[Recommended learning: "PHP Video Tutorial 》】
The above is the detailed content of How to prohibit execution of commands in php. For more information, please follow other related articles on the PHP Chinese website!