You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Magento迁移目录后恢复备份,后台登录遇致命错误求助

Fixing Magento Admin Login Fatal Error: Call to getBlockName() on boolean

Let’s work through this issue step by step—this error in Mage/Captcha/Block/Captcha.php line 43 typically stems from broken captcha configuration or module conflicts after your root directory migration and database restore. Here are targeted fixes to get your admin panel back up:

1. Fully Disable Captcha via Database

Renaming the folder is a quick fix, but we need to ensure all captcha-related configs are turned off in the database too:

  • Run these SQL queries in your database manager (phpMyAdmin, etc.):
    -- Disable all captcha settings
    UPDATE core_config_data SET value = 0 WHERE path LIKE 'captcha/%';
    
    -- Specifically disable admin login captcha
    UPDATE core_config_data SET value = 0 WHERE path = 'admin/captcha/enable';
    
    -- Remove admin login from captcha-enabled forms if present
    UPDATE core_config_data SET value = REPLACE(value, 'adminhtml_login,', '') WHERE path = 'admin/captcha/forms';
    

2. Purge All Cache and Session Data

Your previous cleanup might have missed some cached files—make sure to delete everything in these directories:

  • Delete all files (not the folders themselves) in:
    • public_html/var/cache/
    • public_html/var/session/
    • public_html/var/full_page_cache/
  • If you have SSH access, run this command for a faster cleanup:
    rm -rf var/cache/* var/session/* var/full_page_cache/*
    

3. Verify Base URL Configuration for All Store Views

Double-check that your base URLs are correctly set for every store view (not just the default):

  • Run this query to list all base URL entries:
    SELECT * FROM core_config_data WHERE path IN ('web/unsecure/base_url', 'web/secure/base_url');
    
  • Ensure each entry points to your new root directory: http://www.mydomain.com.br/ (unsecure) and https://www.mydomain.com.br/ (secure). Update any incorrect values.

4. Disable Captcha Module via Configuration File

If the database fixes don’t stick, disable the module directly in its config file:

  • Locate app/etc/modules/Mage_Captcha.xml
  • Change <active>true</active> to <active>false</active>
  • Save the file and clear your cache again

5. Double-Check File Permissions

Even if you checked before, confirm these permissions to avoid file access issues:

  • Set public_html/var/ and all its subdirectories to 755 (or 777 if your shared host requires it)
  • Set index.php and .htaccess to 644
  • If you’re unsure about the correct owner/group, reach out to your shared host support for guidance

6. Check for Missing Database Tables

Your restore might have skipped captcha-related tables. Verify these tables exist in your database:

  • captcha_log
  • captcha_session
  • If they’re missing, restore them from your original backup (or if you don’t need captcha, you can safely ignore this step since we’re disabling the module)

After completing these steps, clear your browser’s cache and try logging into the admin panel again. If the error still occurs, check your Magento logs (var/log/exception.log and var/log/system.log)—they’ll often reveal additional details about what’s failing behind the scenes.

内容的提问来源于stack exchange,提问作者Jadiel Leyendecker

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 06:36:39