Home > Backend Development > PHP Problem > How to prohibit execution of commands in php

How to prohibit execution of commands in php

藏色散人
Release: 2023-03-08 17:06:02
Original
3056 people have browsed it

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.

How to prohibit execution of commands in php

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
Copy after login

If you need multiple instructions, separate them with commas, such as:

disble_function = shell_exec, system, passthru, popen
Copy after login

[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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template