Refresh cache / turn cache off

Always do this first. Clear the Magento cache.

  1. Visit Magento Admin > System > Cache Management
  2. Refresh all caches.

Do yourself a favor and turn off caching in your development environment to save time clearing caches.

Refresh indexes

From Magento Admin

  1. Visit Magento Admin > System > Index Management
  2. Refresh all indexes.

Some indexes cannot be refreshed from the admin (flat tables). You must use the command line.

From command line

cd {magento_root}/shell

# Show status for all indexes
php indexer.php --status

# Show name for all indexes
php indexer.php --info

# Reindex all
php indexer.php --reindexall

# Reindex one index
php indexer.php --reindex catalog_category_flat
php indexer.php --reindex catalog_category_product
php indexer.php --reindex catalog_product_attribute
php indexer.php --reindex catalog_product_flat
php indexer.php --reindex catalog_product_price
php indexer.php --reindex catalog_url
php indexer.php --reindex cataloginventory_stock
php indexer.php --reindex catalogsearch_fulltext
php indexer.php --reindex tag_summary
php indexer.php --reindex url_redirect

Your shell’s PATH variable must contain the correct PHP version (probably PHP 5.6 for Magento 1). You might need to change this in your shell profile before running the indexers.


Indexing fails with MySQL 5.7

Indexers might fail under MySQL 5.7 due to table locking.

In each method change $name to sha1($name) to allow indexers to run:

  • /app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php :: isLocked()
  • /app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php :: releaseLock()
  • /app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php :: setLock()


Database import fails with MySQL 5.7

ERROR 1031 (HY000) at line 291001: Table storage engine for 'catalog_product_relation' doesn't have this option
  1. Open the MySQL dump in a text editor.
  2. Search for ROW_FORMAT=FIXED.
  3. Delete this string.
  4. Try importing again.


Product attribute isn’t rendering

To render product attributes on the frontend they have to be configured correctly. Normally you want this:

Use in layered navigation Filterable (with results)
Use In Search Results Layered Navigation Yes
Visible on Product View Page on Front-end Yes
Used in Product Listing Yes
Used in Product Specifications Yes

Flat tables

Flat tables are extra stubborn. If changes to product attributes appear stuck, then refresh flat tables from the command line:

cd {magento_root}/shell
php indexer.php --reindex catalog_product_flat
php indexer.php --reindex catalog_category_flat


White screen of death

Uncomment this line (temporarily) in /index.php to show PHP errors:

ini_set('display_errors', 1);

Still not seeing PHP errors? Increase the PHP memory limit in /.htaccess:

php_value memory_limit 64M
#php_value memory_limit 128M
#php_value memory_limit 256M

Cookie fix

When you can’t login to the Magento admin after setting up an environment, it’s probably cookies:

In MageAdmin > System > Config > Web > Cookies set the “Cookie Domain” and “Cookie Path” to blank. In your browser, delete all cookies for the environment’s domain. That should work.

Alternatively, disable cookies entirely with a nuclear core hack (only do this locally — be smart):

// See: /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

// GravDept: [cookie-fix]
// Disable getting params.

// session cookie params
$cookieParams = array(
    'lifetime' => $cookie->getLifetime(),
    'path'     => $cookie->getPath()
    //'domain'   => $cookie->getConfigDomain(),
    //'secure'   => $cookie->isSecure(),
    //'httponly' => $cookie->getHttponly()

// GravDept: [cookie-fix]
// Disable unsetting cookie.

if (!$cookieParams['httponly']) {
    if (!$cookieParams['secure']) {
        if (!$cookieParams['domain']) {