When launching a site on new hosting, developers often create a one-line file: <?php phpinfo();. It shows the PHP version, loaded modules and server settings on one page and makes troubleshooting fast. The problem is that the file is almost never deleted afterwards. A page called info.php, test.php or phpinfo.php stays public for months and hands an attacker information they would otherwise struggle to collect.
What a phpinfo() page reveals
It looks like a page of technical numbers, but it is really a map of your server: exact PHP and web server versions, the operating system, loaded extensions, the full path to your site folder, and the temp and session directories. With exact versions an attacker can look up known vulnerabilities and plan a targeted attack. The page also shows restrictions such as disable_functions and open_basedir, which tells them how to work around your limits after an upload exploit.
The most dangerous part is the environment section. Modern frameworks and containers often pass database passwords and API keys through environment variables, and phpinfo() prints $_ENV and $_SERVER in full, so values like DB_PASSWORD can appear on screen. It also echoes the cookies of the current request, which can help session theft when combined with other flaws.
Other forgotten test and utility files
adminer.phpor a copy of phpMyAdmin inside the site: a direct database login form open to password guessing.install.phpor asetup/folder: some systems allow the installer to run again.test.php,mail-test.php: usually contain real passwords.error_log,debug.log: paths, queries and sometimes data.
Framework debug modes are similar: a Laravel project left with APP_DEBUG=true can show code, paths and settings on its error pages.
Example: a school website in Namangan
A private school in Namangan runs example.uz with announcements, timetables and a parent portal. During a hosting move, the developer created info.php to check the PHP version and uploaded adminer.php to inspect the database. Both were forgotten. Weeks later the logs showed thousands of login attempts on adminer.php, because the database user and host were already visible on info.php. A strong password saved the data; deleting two files would have taken a minute.
Checking your site
for f in info.php phpinfo.php test.php i.php adminer.php install.php debug.log error_log; do
echo "$f $(curl -s -o /dev/null -w '%{http_code}' https://example.uz/$f)"
done
A 200 means the file exists and is public. With SSH you can find every file that calls the function, whatever its name:
grep -rlE --include="*.php" "phpinfo[[:space:]]*\(" ~/www/example.uz
Admin areas of some systems call phpinfo() behind a login, which is usually fine. Standalone files in public folders should go.
Fixing it for good
Delete what you do not need. If you must check settings occasionally, use a random file name, remove it right away, or restrict it to your own IP in .htaccess:
<Files "info.php">
Require ip 203.0.113.10
</Files>
If you can edit php.ini, disable the function and hide version details:
disable_functions = phpinfo
expose_php = Off
display_errors = Off
Append phpinfo to an existing disable_functions list rather than replacing it. If test files were exposed for a long time, rotate database and service passwords, especially those stored in environment variables. On sayt.uz hosting, PHP settings and files are managed in the ISPmanager panel opened from your cabinet.