Updated on Jul 11, 2023
Disabling the PHP function phpinfo() has a good reason behind it — security. The phpinfo() function shows information about server settings, PHP values and the Kernel version. Such information can be used for malicious activity and hacker attacks on your website. The downside of disabling phpinfo(), though, is that debugging problems in PHP applications becomes much more difficult.
In this guide we will show you how to enable it on a WHM/cPanel server, in case it has been deactivated.
This post includes:
As we mentioned above, disabling phpinfo is for security reasons. The function shows information about your server which can be used by malicious actors to harm it. The function will not directly enable hackers to harm your server, but instead it can give them the information they need to find a way around your defences.
However, if your WHM/cPanel server is running reliable security software you should not be concerned about phpinfo(). Your security software should stop any attempts at your server before they can do any harm, even if a hacker does have the necessary information from the phpinfo() function. Again: the function by itself will not harm your server.
The function can be enabled by the administrator of the server in question. That means only people with root-level privileges can enable the phpinfo() function.
Our hosting services all come with the phpinfo() function enabled on them by default. There is no need to enable it manually. Our services are also secured by highly reliable and precise security software. If you find that the function does not work for you, please let us know!
If you are one such user then you have two ways to do that.
The first method uses WHM’s MultiPHP Manager tool. To access it follow these steps:
Don’t forget to click the Update button when you are ready. That will save your changes and enable phpinfo() on the server.
This method is a variation of the previous one, but allows you to enable, or disable, the function for individual PHP versions. Once more, you will need root privileges for your server.
The MultiPHP INI Editor method gives you more precise control over the phpinfo() function, in case you want to turn it off only on certain PHP versions.
As you can see, the process of enabling the phpinfo() function is not difficult. It is just a few clicks or a quick removal of the function from a list. The only hurdle here is that you need root-level access to your server. If you do not have it we recommend you contact the server owner, as they should be able to enable it for you.
We hope you find this article useful. Discover more about FastCloud - the top-rated Hosting Solutions for personal and small business websites in four consecutive years by the HostAdvice Community!