The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →If Apache is serving /var/www/html as the hostname’s DocumentRoot, place the file at /var/www/html/phpinfo.php and request https://myservername.com/phpinfo.php. Do not include the server’s filesystem path in the URL. A 404 means the request did not resolve to a file through the mapping used by that virtual host, so you must also verify the active host configuration and the exact filename.
Use the URL path, not the filesystem path
Apache normally maps a request by appending its URL path to the configured DocumentRoot. With a document root of /var/www/html, the mapping is:
| Request | Filesystem location Apache checks | Result |
|---|---|---|
https://myservername.com/phpinfo.php |
/var/www/html/phpinfo.php |
Correct URL when that is the active document root |
https://myservername.com/var/www/html/phpinfo.php |
A path beneath the document root, such as /var/www/html/var/www/html/phpinfo.php |
Usually incorrect |
The filesystem prefix is therefore not ordinarily repeated in the browser address. The Apache 2.4 documentation describes this default URL-to-file mapping, while also noting that virtual-host configuration can change the root used for a request.
Why /phpinfo.php can still return 404
The hostname may use another document root
Apache can assign a different DocumentRoot to each virtual host. The fact that a file exists in /var/www/html does not prove that myservername.com serves that directory. Have the server administrator inspect the server and virtual-host configuration for the exact hostname you are requesting.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
An alias or other mapping may be involved
Aliases and related Apache directives can map a URL to a location outside the document root. If the site uses one, the correct URL may not correspond directly to /var/www/html. Check the mapping that handles this hostname before changing the file location.
The filename may not match
The forum question refers to the created file once as phpinfp.php but uses phpinfo.php in the URLs. Confirm the spelling on disk, including every character and the letter case. On a case-sensitive filesystem, phpinfo.php, PHPInfo.php, and phpinfp.php are different names. A directory listing of the mapped directory can rule out this simple cause.
Rank #2
A practical troubleshooting sequence
- Confirm the file name. Verify that the file is exactly
phpinfo.php, with the expected capitalization. - Confirm the file’s location. Ensure it is inside the directory actually mapped to the requested site, not merely inside a directory that exists on the server.
- Verify the active virtual host. Check which Apache virtual-host definition receives
myservername.comand read itsDocumentRootand any aliases. - Request the URL relative to that mapping. If the active root is
/var/www/html, usehttps://myservername.com/phpinfo.php. If the configuration maps another URL prefix, use that prefix instead. - Check the server logs with the administrator. If the mapping and spelling are correct but the response remains 404, the request may be reaching a different host definition or another server-side rule may be handling it. The access and error logs can show which resource Apache attempted to resolve.
What a phpinfo page shows
PHP’s phpinfo() function outputs detailed runtime information, including the PHP version, compilation options, loaded extensions, server and environment details, paths, and configuration values. That makes a temporary page useful for checking whether the request is reaching PHP and for diagnosing configuration differences.
Keep the diagnostic page temporary
Because the output is detailed, do not treat a publicly reachable diagnostic page as a permanent site feature. Once you have collected the information, remove the test file or restrict it according to your organization’s security practice.
What the original 404 tells you—and what it does not
A 404 confirms that the resource was not found through the mapping handling that request. It does not, by itself, prove that the file is absent from /var/www/html, that PHP is broken, or that the URL syntax is the only problem. The decisive checks are the active virtual host, its document-root or alias mapping, and the exact on-disk filename.
Quick Recap
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




