Magento problems such as white screen and 500 errors can be frustrating. In this guide, we help you solve the most common issues.

First Steps in Troubleshooting

Before you start troubleshooting:

  1. Check the error logs
  2. Enable development mode (temporarily)
  3. Check recent changes - what has changed?
  4. Make a backup before making any changes

Enabling Developer Mode

To see detailed error messages:

bin/magento deploy:mode:set developer

Note: Disable this after troubleshooting for better performance.

Resolving White Screen

A white screen (White Screen of Death) indicates a fatal PHP error.

Step 1: Check Error Logs

# Magento error log
tail -100 var/log/exception.log

PHP error log

tail -100 /path/to/logs/error.log

Apache error log

tail -100 /var/log/apache2/error.log

Step 2: Show PHP Errors

Temporarily add to index.php:

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

Step 3: Common Causes

Memory limit

# Check current limit
php -i | grep memory_limit

Increase via .htaccess

php_value memory_limit 2G

Corrupted cache

rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf generated/*

Permissions

find var generated pub/static pub/media -type d -exec chmod 755 {} \;
find var generated pub/static pub/media -type f -exec chmod 644 {} \;

500 Internal Server Error

Step 1: Check .htaccess

A corrupted .htaccess is a common cause:

  1. Rename .htaccess to .htaccess_backup
  2. Download a fresh .htaccess from Magento GitHub
  3. Test the website

Step 2: PHP Version

Check if the PHP version is compatible:

  • Magento 2.4.6+: PHP 8.1 or 8.2
  • Magento 2.4.4-5: PHP 8.1

Step 3: Database Connection

Test the database connection:

  1. Check credentials in app/etc/env.php
  2. Test connection via phpMyAdmin
  3. Check if the database server is running

Step 4: DI Compilation

rm -rf generated/*
bin/magento setup:di:compile

Cache Issues

Clear All Cache

bin/magento cache:clean
bin/magento cache:flush

Specific Cache

# Only configuration cache
bin/magento cache:clean config

Only full page cache

bin/magento cache:clean full_page

Manual Cache Removal

rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf var/view_preprocessed/*
rm -rf pub/static/frontend/*
rm -rf pub/static/adminhtml/*
rm -rf generated/*

Index Issues

Check Index Status

bin/magento indexer:status

Rebuild All Indexes

bin/magento indexer:reindex

Specific Index

bin/magento indexer:reindex catalog_product_price
bin/magento indexer:reindex catalogsearch_fulltext

Admin Panel Issues

Admin Not Loading

  1. Check admin URL
    bin/magento info:adminuri
  2. Reset admin URL
    bin/magento config:set admin/url/use_custom 0
    bin/magento config:set admin/url/use_custom_path 0
  3. Clear cache
    bin/magento cache:clean

Cannot Log In

  1. Reset admin password:
    bin/magento admin:user:unlock adminusername
    bin/magento admin:user:change-password adminusername newpassword
  2. Check account status in the database (admin_user table)

Extension Issues

Finding Problematic Extension

# Disable all extensions
bin/magento module:disable --all

Re-enable core modules

bin/magento module:enable Magento_Backend Magento_Store ...

Test website

Enable extensions one by one

bin/magento module:enable Vendor_Module

Emergency Extension Removal

If CLI does not work:

  1. Go to phpMyAdmin
  2. Find setup_module table
  3. Delete the problematic module entry
  4. Manually clear var/cache

Database Issues

Repair Database

# Via Magento CLI
bin/magento setup:db:status
bin/magento setup:db-schema:upgrade
bin/magento setup:db-data:upgrade

Repair Tables via phpMyAdmin

  1. Select all tables
  2. Choose "Repair table" from dropdown
  3. Execute

Debugging Tips

Enable Profiler

bin/magento dev:profiler:enable

Then check Profiler output at the bottom of the page.

Query Logging

In app/etc/env.php:

'db' => [
    'connection' => [
        'default' => [
            'profiler' => [
                'class' => '\Magento\Framework\DB\Profiler',
                'enabled' => true
            ]
        ]
    ]
]

XDebug

Configure XDebug for step-by-step debugging in your IDE.

When to Enable Support

Contact support if:

  • You cannot find the cause
  • It seems to be a server-level issue
  • You need changes that require admin rights
  • The problem keeps recurring

Need Help?

We are here for you! Are you facing any issues or have questions? Our support team is happy to assist you personally. Send us a message via the ticket system - we usually respond within a few hours and are happy to help.