Push the limits of your Adobe Commerce store with MagePal Extension

Take your Adobe Commerce store to new heights with the power of MagePal extensions. Our expertly crafted code and rigorous testing ensure seamless integration with Adobe Commerce, giving you the freedom to focus on growing your business, not debugging. Upgrade your store's potential with MagePal.

How to enable error reporting in Magento 2.x

Does your Magento store shows a blank white page, a blank page with a error number, 500 Internal Server or broken content with missing footer?

Magento will display error message differently base on if your server is in production or developer mode. If your are debugging an issue on a none production server, you should considering switching your Magento store to developer mode.

Magento Display Blank White Page

If you are getting a blank white page in Magento, this is mostly cause by a fatal php error that php can not recover from and for security reason most server are configure by default to hide the error message because it may contain sensitive information.

The quickest way to debug a blank page error is to figure out what actually causing the issue by

  1. Checking your php error / apache error logs by connecting to your server via sshing, ftping, use cPanel file manager or open a support ticket with your hosting company to see how to get access to your error log files

  2. If you do not have access to your server error or don’t know the location, you can force php to print the error message to your browser by editing your index.php

 error_reporting(E_ALL);
 ini_set('display_errors', 1);

Eg. index.php

 <?php
 ...
  error_reporting(E_ALL);
  ini_set('display_errors', 1);
 
 try {
     require __DIR__ . '/app/bootstrap.php';
 } catch (\Exception $e) {
...

To prevent sensitive information from display to your user, you can hard code your ip address to only display the error message to your ip address.

 ...
 ipAddress = [
    'your public ip address here'
 ];
 
 if (in_array($_SERVER["REMOTE_ADDR"], ipAddress) {
     error_reporting(E_ALL);
     ini_set('display_errors', 1);
 }
 ...

Magento Display Blank White Page with Error Message (There has been an error processing your request)

Ssh into into your web server, then navigate to your Magento2 root folder/var/report then view the file name refer in the error message.

This type of error normally happen when php encounter an error while outputting the content of the page that force php to stop.

To debug view your browser page source, then scroll to the bottom of the page and check for any error information. If not error is present then enable error reporting and try again.

Debug Steps

  1. Check php error / apache / NGINX error log files in the /var/log/ folder
  2. Check your Magento 2 error folder in Magento root var folder (var/report/*, var/log/debug.log, var/exception.log and system.log)
  3. Check your Magento mode (default, developer or production)
  4. Check your server php error log setting
0

Total Downloads

11

years experience with Magento

30+

Magento / Adobe Commerce Extensions

Shop with confidence

With millions of downloads worldwide, install with confidence knowing that our extensions will just work.

Learn More About MagePal Extension

Is your Magento store ready for the future? Say hello to the new Google Analytics 4, which is built from the ground up with all-new features and advanced machine learning technology.

GA4 Extension

Related

Magento 2 Extensions

Maximize your Magento 2 store's potential with MagePal extensions - The ultimate solution for e-commerce success.

DataLayer for Tag Manager

Whether you are integrating Bing, Facebook, SnapChat, Pinterest, or any other services our extension make it easy.

Enhanced Transactional Emails

Get more from your order confirmation emails by promoting other complementary products.

Catalog Hover Image for Magento

Quickly previewing alternative product images on your category list page.