Troubleshooting
Refresh cache / turn cache off
Always do this first. Clear the Magento cache.
- Visit
Magento Admin > System > Cache Management
- 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
- Visit
Magento Admin > System > Index Management
- 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.
Reference
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()
Reference
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
- Open the MySQL dump in a text editor.
- Search for
ROW_FORMAT=FIXED
. - Delete this string.
- Try importing again.
Reference
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
Reference
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:
- Ashley Schroder: Fixing Magento Login Problem after a Fresh Installation
- Phillip Jackson: I can’t login to Magento Admin
- Yireo: Unable to login into the Magento backend
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']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
*/