Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Exposed phpinfo and debug pages: how to find and remove them

OPS-166Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

phpinfo() is a PHP function that prints a full report of the server: PHP version, loaded modules, file paths, environment variables and configuration. Developers often drop it into a file called phpinfo.php or info.php to check a setup, then forget to delete it.

Debug endpoints are similar. Examples are Laravel's debug error page (when APP_DEBUG=true), the Symfony profiler at /_profiler, WordPress with WP_DEBUG displaying errors, Apache's /server-status, and framework tools such as Django debug pages or Spring Boot /actuator routes. They are made for developers, not for the public.

Why it costs you leads or sales

These pages do not break your funnel on their own. The cost is indirect. They hand attackers a map of your server: exact software versions to match against known vulnerabilities, full file paths, and sometimes database hosts, API keys or secrets in environment variables. A hacked site can be defaced, redirected, flagged by browsers or ad platforms, or used to steal customer data. That means lost leads, suspended ad accounts and a damaged reputation.

How a leftover debug page turns into lost revenue
  1. Visitor finds /phpinfo.phpBots scan for common file names all the time
  2. Versions and paths readAttacker learns PHP, modules and server layout
  3. Known exploit or stolen keyMatched to your software or leaked secret
  4. Site compromisedRedirects, malware, data theft, ad account flags

The leak itself is quiet. The damage comes later.

How to check if your site has it

Open a private browser window and try the paths below on your own domain. Any page that shows server details, a stack trace or a debug toolbar is a problem. A 404 or 403 is what you want.

Common exposed debug paths to test on your own site
PathWhat it may exposeGood result
/phpinfo.php, /info.php, /test.phpFull PHP configuration and environment404 or 403
/_profilerSymfony profiler with requests and config404 or 403
/server-statusApache live requests and client IPs403
/actuator, /actuator/envSpring Boot internals and environment404 or login required
/wp-content/debug.logWordPress errors with paths404 or 403
Any page with a stack traceDebug mode on (Laravel, Django, others)Generic error page
Check status codes from a terminalbash
for p in phpinfo.php info.php test.php server-status _profiler wp-content/debug.log actuator/env; do
  printf "%s " "$p"; curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/$p"
done

Also search your code or file manager for the string phpinfo(. In WordPress, check whether WP_DEBUG and WP_DEBUG_DISPLAY are set to true in wp-config.php.

How to fix it

Remove and block exposed debug pages
  1. Delete the test files

    Remove phpinfo.php, info.php, test.php and similar from the web root, including subfolders and old staging copies. Use SFTP, your host's file manager or SSH.

  2. Turn debug mode off

    Set the framework to production mode: APP_DEBUG=false in Laravel, disable the profiler outside dev in Symfony, DEBUG=False in Django, WP_DEBUG false in WordPress.

  3. Block debug routes at the web server

    Deny access to /server-status, /_profiler, log files and similar paths with the rules below, as a second layer.

  4. Rotate secrets that were visible

    If the page was public, change database passwords, API keys and salts that appear in environment variables or config.

  5. Clear caches

    Purge your CDN and page cache so no copy of the old page is still served.

Fix by platform
  1. Turn off debug display

    In wp-config.php set define('WP_DEBUG', false); and define('WP_DEBUG_DISPLAY', false); Remove any debug.log from wp-content.

  2. Remove stray files

    Look in the site root and wp-content for phpinfo.php or test files, and delete them. Deactivate and delete any plugin you installed only to show server info.

nginx: block debug pathsnginx
location ~* ^/(phpinfo|info|test)\.php$ { return 404; }
location = /server-status { return 404; }
location ^~ /_profiler { return 404; }
location ~* \.log$ { deny all; }
Apache .htaccess: block debug fileshtaccess
<FilesMatch "^(phpinfo|info|test)\.php$">
  Require all denied
</FilesMatch>
<FilesMatch "\.log$">
  Require all denied
</FilesMatch>
Before and after

Exposed

  • /phpinfo.php shows PHP version, paths and environment
  • Errors show stack traces to visitors
  • debug.log downloadable

Locked down

  • Test files deleted, URLs return 404
  • Visitors see a generic error page
  • Logs blocked and kept out of the web root

How to confirm it's fixed

Confirmation checklist
  • Each path in the table returns 404 or 403 in a private window
  • The curl loop shows no 200 responses for debug paths
  • A deliberately bad URL shows a generic error, not a stack trace
  • No file containing phpinfo( remains in the web root
  • CDN and page caches purged
  • Exposed keys and passwords rotated

How to prevent it happening again

Prevention habits
  • Never leave test files on a live server; delete them in the same session
  • Keep debug flags in environment settings that default to off
  • Add a deploy step that fails if phpinfo( appears in the code
  • Keep logs outside the public web root
  • Restrict admin and monitoring tools by IP or login
  • Repeat the path check after every major release or server move

How FunnelGuard handles this

FunnelGuard does not check for exposed phpinfo or debug endpoints today. It is a possible future check. FunnelGuard runs your real customer journeys, such as lead forms, checkouts and booking buttons, and checks tracking hits and whether test leads arrive. That can show you when a site compromise or a broken deploy breaks those journeys, but it is not a security scan.

To watch for this issue, run the curl loop above after each deploy, or add it to your deployment pipeline. A vulnerability scanner or your host's security tools can also test for common exposed files. A free read-only FunnelGuard audit is available, but it is not a replacement for a security review.

Questions people ask

What is an exposed phpinfo page?

It is a public page, usually phpinfo.php, that prints your PHP version, modules, file paths and environment variables. Anyone who finds it can use the details to plan an attack. It should be deleted from any live site.

Is phpinfo.php dangerous?

Yes, on a live site. It does not break anything by itself, but it reveals software versions, server paths and sometimes secrets stored in environment variables. Attackers and bots look for it routinely.

How do I remove phpinfo.php from my website?

Delete the file from your web root using SFTP, SSH or your host's file manager, and search for other files containing phpinfo(. Then request the URL to confirm it returns 404 and purge any CDN cache.

How do I turn off debug mode in production?

Set the debug flag to false in your live environment: APP_DEBUG=false in Laravel, DEBUG=False in Django, and WP_DEBUG false in wp-config.php for WordPress. Then trigger a test error and check that visitors see only a generic page.

Why is my debug.log file publicly accessible?

WordPress writes debug.log to wp-content when WP_DEBUG_LOG is on, and web servers will serve it unless blocked. Turn the logging off, delete the file, and deny access to .log files in your server config.

Should I rotate passwords after exposing phpinfo?

If the page was publicly reachable, yes for anything shown in environment variables or config, such as database passwords and API keys. You cannot know who viewed it, so rotating is the safe choice.

Does FunnelGuard detect exposed phpinfo pages?

No. FunnelGuard does not check for this yet, though it is a possible future check. Use a curl check after deploys or a vulnerability scanner to watch for it.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: site safety (Stage 26, daily): /phpinfo.php (verified sites).

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.