Opencart 1.5.6.4图片上传异常求助:弹窗重复登录页面无法上传
Hey there, sorry to hear you've been stuck on this frustrating image upload issue for hours—let's break down the most common fixes that resolve this exact problem in OpenCart 1.5.6.4:
Check Admin Session & Cookie Settings
- Log into your admin panel and navigate to
System > Settings > Edit > Servertab - Make sure
Session Lifetimeis set to a reasonable value (like 3600 seconds/1 hour) — too short a lifetime can cause sessions to expire mid-upload - Verify
Cookie DomainandCookie Pathare configured correctly:- For a main domain like
yourstore.com, set Cookie Domain to.yourstore.com(note the leading dot) and Cookie Path to/ - For a subdomain like
store.yourstore.com, use.store.yourstore.comand/
- For a main domain like
- Save changes, clear your browser's cache and cookies, then log back in to test uploads
- Log into your admin panel and navigate to
Fix File & Folder Permission Issues
- On your server, set permissions for
admin/controller/common/filemanager.phpandadmin/model/tool/image.phpto644 - Ensure the
admin/image,image/data, andimage/cachefolders have permissions set to755— the PHP user needs write access to these directories for uploads to work properly - If you're unsure how to adjust permissions, use your hosting control panel's file manager or an FTP client
- On your server, set permissions for
Resolve HTTPS/URL Rewrite Conflicts
- If your site uses HTTPS, double-check the
admin/config.phpfile for correct HTTPS definitions:define('HTTPS_SERVER', 'https://yourstore.com/admin/'); define('HTTPS_CATALOG', 'https://yourstore.com/'); - If you're using URL rewriting (mod_rewrite), inspect your
.htaccessfile to ensure there are no rules incorrectly redirecting admin panel requests, especially those targeting the File Manager's AJAX endpoints
- If your site uses HTTPS, double-check the
Temporarily Disable Security Extensions
Some third-party security plugins (like login limiters or captcha tools) can misidentify the File Manager's popup requests as unauthorized access, triggering a redirect to the login page. Try:- Renaming the plugin's directory via FTP (e.g., change
admin/extension/module/security-plugintosecurity-plugin-disabled) - Test image uploads again — if it works, adjust the plugin's settings or find an alternative that doesn't interfere with the File Manager
- Renaming the plugin's directory via FTP (e.g., change
Rule Out Custom Theme/Modification Issues
- Switch back to the default admin theme temporarily to see if the upload works — custom themes sometimes modify session handling code in
admin/view/template/common/header.tplthat breaks the popup - If you've modified core files related to sessions or file management, revert those changes (or restore from a backup) to check if that's the root cause
- Switch back to the default admin theme temporarily to see if the upload works — custom themes sometimes modify session handling code in
Try these steps one by one—most users fix this issue with the first two checks. Let me know if you hit any snags along the way!
内容的提问来源于stack exchange,提问作者unitSphere

