Windows下安装,前台及后台不能正常显示,部分JS404,找不到的路径较短,应该是不正确

5.70K 浏览M2交流区

Windows下安装,前台及后台不能正常显示,部分JS404,找不到的路径较短,应该是不正确


0

记录一下xampp + windows10 +magento2.3.5本地环境不工作
1 php bin/magento deploy:mode:show
PHP Warning: PHP Startup: Unable to load dynamic library 'php_mcrypt.dll'

提示找不到php.mcrypt.dll
https://windows.php.net/downloads/pecl/releases/mcrypt/1.0.3/
下载对应的dll文件 php_mcrypt.dll
解压复制粘贴到C:xamppphpext

2 php bin/magento deploy:mode:show 现在正常工作显示
Current application mode: default. (Note: Environment variables may override this value.)

3 php bin/magento deploy:mode:set developer
Enabled developer mode.

4 前台依旧报错
1 exception(s):
Exception #0 (MagentoFrameworkExceptionValidatorException): Invalid template file: 'C:/xampp/htdocs/magento2.3.5/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js

5 open file /vendor/magento/framework/View/Element/Template/File/Validator.php in magento install dir , find
$realPath = $this->fileDriver->getRealPath($path);
replace with :
$realPath = str_replace('', '/', $this->fileDriver->getRealPath($path));

open file app/etc/di.xml in magento install dir, find

MagentoFrameworkAppViewAssetMaterializationStrategySymlink

and replace with

MagentoFrameworkAppViewAssetMaterializationStrategyCopy

6 done 解决

0
您正在查看4个回答中的1个,单击此处查看所有回答。