Magento 1.9装EbizCharge模块后后台无法访问,报注册表键重复错误
Hey there, sorry to hear you're hitting this roadblock with your EbizCharge module installation on Magento 1.9. That registry key error usually pops up when a singleton object (in this case, the econnect/observer observer) is being instantiated more than once, or there's a duplicate configuration entry for the observer. Let's walk through the fixes step by step:
1. Check for Duplicate Observer Configurations
First, head to your module's configuration file at app/code/[community/local]/EbizCharge/[ModuleName]/etc/config.xml (replace the placeholders with the actual path of your EbizCharge module). Look for the <global> → <events> section.
Make sure you don't have duplicate entries for the same observer tied to any event. For example, if you see two <econnect_observer> nodes under the same event (or different events pointing to the same observer class without proper singleton handling), that's likely the culprit. Remove any redundant entries so each observer is registered only once per event it needs to listen to.
2. Clear Magento Cache
Magento 1.9 heavily relies on cached configuration files, so even if you fixed the config, old cached data might still be causing the issue. Do this via FTP:
- Navigate to the
var/cachedirectory and delete all files and folders inside it. - Also delete everything in
var/full_page_cache(if it exists).
If you have access to the server's command line, you can run these commands instead:
rm -rf var/cache/* rm -rf var/full_page_cache/*
Just make sure you're in your Magento root directory when executing them.
3. Inspect the Observer Class Code
Open the observer class file (usually at app/code/[community/local]/EbizCharge/[ModuleName]/Model/Observer.php) and check if there's any code that's incorrectly instantiating the singleton again.
Look for lines like:
Mage::getSingleton('econnect/observer');
If this line exists inside the observer's methods (especially the constructor), it's creating a loop that tries to instantiate the singleton multiple times. Remove or adjust this code so the observer doesn't call its own singleton.
4. Verify File Permissions
Incorrect file permissions can sometimes cause partial file loading, leading to unexpected behavior. Ensure all uploaded EbizCharge module files have the correct permissions:
- Files should be set to
644 - Directories should be set to
755
You can adjust permissions via FTP (right-click → File Permissions) or with command line:
find app/code/[community/local]/EbizCharge -type f -exec chmod 644 {} \; find app/code/[community/local]/EbizCharge -type d -exec chmod 755 {} \;
5. Temporarily Disable the Module to Test
If none of the above works, let's confirm the module is the source of the issue. Edit the module's activation file at app/etc/modules/EbizCharge_*.xml (the exact filename depends on the module) and change <active>true</active> to <active>false</active>.
Clear the cache again, then try accessing the admin panel. If it loads normally, the problem is definitely within the EbizCharge module's configuration or code—go back to steps 1-3 to dig deeper.
内容的提问来源于stack exchange,提问作者ahsan123

