The example in this article describes the solution to the PHP prompt Warning:phpinfo() has been disabled function. Share it with everyone for your reference. The specific analysis is as follows:
Today when I was testing a website on a friend’s server, I found that I encountered the PHP Warning: phpinfo() has been disabled for security reasons when testing phpinfo. According to the meaning of the words, I summarized the solution. Let’s take a look at it together. Let’s see.
When running phpinfo, I encountered the following prompt: PHP Warning: phpinfo() has been disabled for security reasons in XX.php on line XX
The meaning of this paragraph is to tell us that the phpinfo() function is disabled due to security considerations. If you have server management rights, please modify the php.ini configuration file parameters and restart apache to re-enable it.
Open the php installation path and open the php.ini file. Specific example: There is a disable_functions configuration in php.ini. In the default configuration, cli execution functions are prohibited. If necessary, you need to change disable_functions in php.ini. = phpinfo, exec, popen, system ...., delete the function you need to execute from the list and restart apache.
It is entirely a configuration problem. The solution in Linux is to edit the PHP configuration file:
vi /usr/local/php/etc/php.ini
Look for the disable_functions string and delete the scandir behind it. Tip: You can enter / under vi to enter the search mode and easily find disable_functions.
Restart PHP to take effect:
I hope this article will be helpful to everyone’s PHP programming design.