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