php method to turn off the phpinfo() function: first find and open the "php.ini" configuration file; then find the "disable_functions=" item in the configuration file, and add "phpinfo," after the "=" sign value, save the file; finally restart the WEB service.

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
I believe that students who have been exposed to PHP are aware of phpinfo( ) The most common usage of this function is that we use it to test whether the PHP environment is successfully built or to detect PHP-related environment information.

Generally we will not disable this function. Because of the powerful function of phpinfo() function, some sensitive information of the server is often easily leaked.
So some cloud host security platforms and security scanning devices will define this function as a dangerous function or treat it as a vulnerable file.
If we want to avoid security scanning problems, we can manually set the php.ini configuration file to disable this function.
Find the PHP installation directory and open the php.ini configuration file, as shown in the figure below

Use Notepad to open the php.ini file and search for keywords "disable_functions", as shown in the picture

Add the function phpinfo that needs to be disabled and save it, and restart the WEB service, such as APACHE, IIS, NGINX, as shown in the picture below

Test again after completion. If you want to disable other functions, you can also add them according to the above method.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to close phpinfo() function in php. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),






