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

Modify the php.ini file to disable the function

王林
王林 Original
2021-07-06 15:42:36 3619browse

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

Shielded function example:

disable_functions= phpinfo,dl, exec, system

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!

php
Statement:
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