How to Fix an Exposed phpinfo Page

To fix an exposed phpinfo page, you need to first locate the file and restrict its access. This guide provides practical steps to help secure your site and protect sensitive information that could be exploited by attackers. Securing your phpinfo page is essential to safeguarding your website from potential vulnerabilities.

How to fixUpdated 3 min read

An exposed phpinfo page can inadvertently reveal critical server details to anyone who visits it, posing a significant security risk to your business. Fortunately, you can take simple actions to mitigate this threat effectively, making sure your site remains secure without unnecessary exposure.

This page will guide you through the steps to identify and secure an exposed phpinfo file, focusing on practical solutions that you can implement immediately. Ensure your online presence stays protected with our straightforward advice.

Step 1: Identify the phpinfo Page Location

The first step to fix an exposed phpinfo page is to locate where it resides on your server. This file is commonly named phpinfo.php and might be found in directories like 'public_html' or any custom directory used for web content.

Step 2: Remove or Rename the phpinfo File

Once located, the best immediate action is to either delete the phpinfo file or rename it to something less predictable. This blocks public access and prevents potential attackers from gathering sensitive server information.

Step 3: Restrict Access Using .htaccess

For a more secure approach, use a .htaccess file to restrict access to the phpinfo page by IP address. This ensures that only authorised personnel can view the file if needed without exposing it to the wider internet.

Free, instant, no account

See your site's security grade in seconds.

Free, instant, and no account needed to see your grade.

Scan my site free

Plain-English A to E grade in about 10 seconds. No account needed to see it.

Step 4: Verify Changes Are Effective

After implementing these changes, verify that the phpinfo page is no longer accessible. Attempt to visit the URL and ensure it results in a '404 Not Found' error or a similar server response indicating restricted access.

Checking with ebsecurity.co.uk

Our free tool identifies if your phpinfo page is exposed but cannot remedy it. After securing your page, use the scanner to confirm no further exposure. The ebsecurity.co.uk check can reassure you that the page is no longer publicly accessible.

To fix an exposed phpinfo page, quickly locate and secure the file by removing or renaming it, and use .htaccess to restrict access. Use ebsecurity.co.uk to confirm the issue is resolved.

Common questions

Why is exposing the phpinfo page a security risk?
Exposing the phpinfo page is a security risk because it reveals detailed server information, which attackers can exploit to find vulnerabilities. Securing it is crucial to protect your site's integrity.
How can I check if my phpinfo page is exposed?
You can check for an exposed phpinfo page using the ebsecurity.co.uk scanner. It identifies publicly accessible phpinfo files and informs you of any exposures that need attention.
Can I just delete the phpinfo page?
Yes, deleting the phpinfo page is a practical solution. It eliminates the risk of exposure but ensure no critical operations require it before removal. Always back up important files.
What does ebsecurity.co.uk scanner do?
The ebsecurity.co.uk scanner checks for exposed phpinfo pages and other security aspects externally. It identifies security risks but does not fix them; manual intervention is needed post-detection.
How often should I check for exposed pages?
Regularly scanning your site for exposures, especially after updates or changes, is recommended. Frequent checks ensure no new vulnerabilities are unintentionally exposed over time.

How safe is your website?

A free A to E grade in about 10 seconds. No account needed.

Check my site