目录
2、删除 var\cache\* 和 var\session\* 下所有文件
1、清除cookie
删除来自某个网站的 Cookie
- 在计算机上打开 Chrome。
- 在右上角,依次点击“更多”图标
设置。
- 在“隐私设置和安全性”下方,点击 Cookie 及其他网站数据。
- 点击查看所有 Cookie 和网站数据。
- 在右上角,搜索相应网站的名称。
- 在该网站的网址右侧,点击“移除”图标
。
无法解决继续下面的操作
2、删除 var\cache\* 和 var\session\* 下所有文件
rm -rf var\cache\*
rm -rf var\session\*
刷新页面看看有没有解决问题
3、复位magento基本配置,开启前后台https
php bin/magento config:set web/cookie/cookie_domain NULL
php bin/magento config:set web/unsecure/base_url http://www.yoursite.com/
php bin/magento config:set web/secure/base_url https://www.yoursite.com/
php bin/magento config:set web/secure/use_in_frontend 1
php bin/magento config:set web/secure/use_in_adminhtml 1
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush
Invalid Secure Base URL. Value must be a URL or one of placeholders: {{base_url}},{{unsecure_base_url}}
Invalid Base URL. Value must be a URL or one of placeholders: {{base_url}}
注意:出现上面的错误,请检查链接地址是否用了特殊字符,或是不标准。必须是 http 或者 https 开头 "/" 反斜杠结尾
还是不行可以尝试换个浏览器,再做一次步骤1、清除cookie
4、重新安装
卸载系统
注意:这会清空数据库,谨慎操作。
php bin/magento setup:uninstall
重装
php bin/magento setup:install --base-url=http://magento --db-host=localhost --db-name=magento --db-user=magento --db-password=magento --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=it_IT --currency=EUR --timezone=Europe/Rome --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=127.0.0.1 --elasticsearch-port=9200
5、前台显示空白页问题
问题:更新静态页后前台显示空白页或者提示Error: Call to a member function setActive() on bool in C:\www\magento\vendor\magento\module-backend\Model\View\Result\Page.php:27 Stack trace: #0 C:\www\magento\vendor\magento\module-backend\Controller\Adminhtml\Dashboard\Index.php(39): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Backend...') #1 C:\www\magento\vendor\magento\framework\App\Action\Action.php(111): Magento\Backend\Controller\Adminhtml\Dashboard\Index->execute() #2 C:\www\magento\vendor\magento\module-backend\App\AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #3 C:\www\magento\vendor\magento\framework\App\FrontController.php(186): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http)) #4 C:\www\magento\vendor\magento\framework\App\FrontController.php(118): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Magento\Backend\Controller\Adminhtml\Dashboard\Index)) #5 C:\www\magento\vendor\magento\framework\App\Http.php(116): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http)) #6 C:\www\magento\vendor\magento\framework\App\Bootstrap.php(263): Magento\Framework\App\Http->launch() #7 C:\www\magento\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) #8 {main}
解决方式:重新执行一次开启开发者模式
php bin/magento deploy:mode:set developer
有配置Grunt的执行
grunt clean
Grunt配置参考 《Magento 2 windows 开发环境 Grunt css样式管理 livereload 实时预览》
我的碰到的问题重装就已经解决了,不过静态页面还存在问题,可以参考【Magento 2.4 windows10 安装中碰到的问题】 来解决,另外magento 官方在 2.4 之后对windows 支持很差,建议换到linux平台。