The following prompt appears when running phpinfo:
PHP Warning: phpinfo () has been disabled for security reasons in XX. php on line XX
This section tells us that the phpinfo () function is disabled due to security considerations. If you have the server management permission, modify the parameters of the php. ini configuration file and restart apache to re-enable it.
Open the php installation path and open the php. Ini file.
Specific instance
In php. in ini, the disable_functions configuration exists. In the default configuration, the cli execution function is disabled. If necessary, you must go to php. in ini, disable_functions = phpinfo, exec, popen, system .... , Remove the functions you want to execute from the list and restart apache.
Configuration issues.
Solution in linux
Edit the PHP configuration file:
Vi/usr/local/php/etc/php. ini
Search for the disable_functions string and delete the scandir (Note: Enter/in the search mode under vi to easily find disable_functions)
Restart PHP to take effect
/Etc/init. d/php-fpm restart