Home > Backend Development > PHP Problem > Modify the php.ini file to disable the function

Modify the php.ini file to disable the function

王林
Release: 2023-03-11 09:42:01
Original
3747 people have browsed it

The way to modify the php.ini file to disable functions is to set the disable_functions option to [disable_functions= phpinfo,dl, exec, system] and disable the functions as needed.

Modify the php.ini file to disable the function

The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.

In php, we can disable functions by modifying the php.ini configuration file.

There is a disable_functions switch option in the php.ini file. This option can turn off some dangerous functions, such as system, exec, etc. For example: disable_functions = phpinfo, if the phpinfo() function is called in the file, then when error_reporting is turned on, the following error will be prompted:

Warning: phpinfo() has been disabled for security reasons
Copy after login

Shielded function example:

disable_functions= phpinfo,dl, exec, system
Copy after login

Related recommendations: php tutorial

The above is the detailed content of Modify the php.ini file to disable the function. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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