phpinfo() is not working it shows blank page but other php working

phpinfo() is not working it shows blank page but other php working

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Diagnosing Silent phpinfo() Failures

When a script renders HTML content correctly—like echoing a <div> tag—but suddenly produces a blank white screen upon executing phpinfo(), the issue is almost never about PHP syntax or the phpinfo() function itself. The fact that other code executes proves your PHP installation, opcode cache, and core directives are functioning. This specific behavior points to an output buffering conflict or a misconfigured handler for informational pages.

The most common culprit on shared hosting environments, including providers like x10hosting, is the interaction between output_buffering and error reporting. If your server has aggressive error handling configured at the .htaccess level or via global settings, PHP might be catching a fatal warning before it can render the massive HTML table that phpinfo() generates. This often happens if the output buffer is full or if an extension (like GD or Curl) fails to load silently during the initialization phase of the info page.

To troubleshoot this without relying on visual output, you need to inspect the server logs immediately. Check your Apache error log or Nginx access/error logs for any lines corresponding to the request of phpinfo.php. You will likely find a message indicating a failed opcode cache load or a missing extension that is strictly required by the system but not by standard application code.

# Check Apache error logs for specific failures
tail -f /var/log/apache2/error.log | grep phpinfo

# Or check Nginx if that is your stack
tail -f /var/log/nginx/error.log | grep "phpinfo"

If the logs are clean, the issue often lies in how the output is being sent. Some hosting configurations force output_buffering = On by default to prevent half-written pages from displaying during errors. When phpinfo() runs, it dumps a huge amount of data into this buffer. If there is any preceding whitespace in your file (even a single invisible byte) or if the script is being interpreted as text/plain instead of text/html due to a missing MIME type mapping, the browser might render nothing visible.

Verify that your phpinfo.php file has no Byte Order Mark (BOM). Many text editors insert a BOM by default when saving as UTF-8, which breaks PHP execution on Windows but can cause subtle issues on Linux if not handled correctly by specific handlers. Ensure you are saving the file with "No BOM" selected in your editor.

Another frequent oversight involves the display_errors directive. While this setting controls whether errors appear in the browser, it doesn't always suppress the underlying fatal error that causes the blank page. If an extension is missing, PHP might throw a fatal error that is swallowed by the buffer before reaching the user.

; Add to your php.ini or .htaccess to force error visibility for debugging
display_errors=On
error_reporting=E_ALL

With these settings enabled, run phpinfo() again. If you now see a generic "Fatal error: Call to undefined function" or a missing extension error message, you have identified the root cause. The solution is either to install the missing module via your control panel or, if using shared hosting, to request that the provider disables strict requirements for non-critical extensions.

If phpinfo() still fails after enabling error reporting, check the file permissions. While rare, a directory with restricted write permissions can sometimes prevent the PHP handler from flushing the buffer correctly on specific server configurations. Ensure the web root is writable by the Apache/Nginx user but not executable if it shouldn't be.

Finally, consider that phpinfo() is deprecated in favor of php -i for command-line inspection. If you cannot get the browser to display the output due to persistent buffering issues, access your server via SSH and run php -i | grep "Loaded Extensions". This bypasses the web server entirely and confirms exactly which components are active without relying on the HTTP response headers or buffer flushing logic that breaks in the browser.

For developers managing complex deployments where debugging tools like this are critical, ensuring a robust error logging pipeline is essential. If you are building an application based on Laravel, utilizing packages like laravelcompany.com can help streamline environment checks and ensure your configuration matches best practices for production stability.

Our network