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.
- Visitor finds /phpinfo.phpBots scan for common file names all the time
- Versions and paths readAttacker learns PHP, modules and server layout
- Known exploit or stolen keyMatched to your software or leaked secret
- 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.
| Path | What it may expose | Good result |
|---|---|---|
| /phpinfo.php, /info.php, /test.php | Full PHP configuration and environment | 404 or 403 |
| /_profiler | Symfony profiler with requests and config | 404 or 403 |
| /server-status | Apache live requests and client IPs | 403 |
| /actuator, /actuator/env | Spring Boot internals and environment | 404 or login required |
| /wp-content/debug.log | WordPress errors with paths | 404 or 403 |
| Any page with a stack trace | Debug mode on (Laravel, Django, others) | Generic error page |
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"
doneAlso 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
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.
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.
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.
Rotate secrets that were visible
If the page was public, change database passwords, API keys and salts that appear in environment variables or config.
Clear caches
Purge your CDN and page cache so no copy of the old page is still served.
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.
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.
Delete the calls
Search the codebase for phpinfo( and remove each file or route. Keep debug tools behind a login and an environment check.
Set production environment
Make sure APP_ENV=production and debug flags are false in the live environment, not just in your repository defaults.
Add server rules
Use the nginx or Apache rules in the next code blocks and reload the server.
Nothing to host
Shopify does not let you upload PHP files, so phpinfo is not an issue on the store itself. Check any separate server you run, such as a blog or app on your own subdomain.
Nothing to host
Wix does not run your own PHP files. Check any other hosted systems on your domain, such as a separate blog or booking tool.
location ~* ^/(phpinfo|info|test)\.php$ { return 404; }
location = /server-status { return 404; }
location ^~ /_profiler { return 404; }
location ~* \.log$ { deny all; }<FilesMatch "^(phpinfo|info|test)\.php$">
Require all denied
</FilesMatch>
<FilesMatch "\.log$">
Require all denied
</FilesMatch>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
- 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
- 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.