Some server administrators may choose to disable the PHP function phpinfo() for security purposes, because it shows information which can be used to compromise the server that your site is operating on.
Here are the steps to disable it.
SSH to server as a rootuser
Edit the php.ini file.
disable_functions = phpinfo
OR we can do the same within .htaccess file by adding the following line:
php_value disable_functions phpinfo
Same way we can disable other php functions in PHP.ini file:
disable_functions = "show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open, allow_url_fopen"
So this is all you have to do, Also read about Warning: Phpinfo() Has Been Disabled For Security Reasons. Please Give your opinion below if you experience any issues or to discuss your ideas and experiences.