6

I'm trying to install a Magento 2.3 instance to my localhost(WAMP server) but after installation process(I use a command line to install) not Admin part or storefront part works correctly. It shows a lot of errors in a browser console and doesn't load Admin part at all and front part only partly. I'm using PHP 7.2.4 but also tried to use 7.1.16(it provides the same result). enter image description here

And a log file says:

[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js' [] []
[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/wysiwyg/active_editor.phtml' in module: 'Magento_Ui' block's name: 'theme.active.editor' [] []
[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-translation/view/base/templates/translate.phtml' in module: 'Magento_Translation' block's name: 'translate' [] []
[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/components.phtml' in module: '' block's name: 'head.components' [] []
[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/calendar.phtml' in module: '' block's name: 'head.calendar' [] []
[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/logger.phtml' in module: 'Magento_Ui' block's name: 'logger' [] []
[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/header.phtml' in module: 'Magento_Backend' block's name: 'logo' [] []
[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/admin/login.phtml' in module: 'Magento_Backend' block's name: 'admin.login' [] []
[2018-11-30 09:31:06] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/copyright.phtml' in module: 'Magento_Backend' block's name: 'copyright' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/wysiwyg/active_editor.phtml' in module: 'Magento_Ui' block's name: 'theme.active.editor' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-translation/view/base/templates/translate.phtml' in module: 'Magento_Translation' block's name: 'translate' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/components.phtml' in module: '' block's name: 'head.components' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/calendar.phtml' in module: '' block's name: 'head.calendar' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/logger.phtml' in module: 'Magento_Ui' block's name: 'logger' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/header.phtml' in module: 'Magento_Backend' block's name: 'logo' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/admin/login.phtml' in module: 'Magento_Backend' block's name: 'admin.login' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/copyright.phtml' in module: 'Magento_Backend' block's name: 'copyright' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/wysiwyg/active_editor.phtml' in module: 'Magento_Ui' block's name: 'theme.active.editor' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-translation/view/base/templates/translate.phtml' in module: 'Magento_Translation' block's name: 'translate' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/components.phtml' in module: '' block's name: 'head.components' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/calendar.phtml' in module: '' block's name: 'head.calendar' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/logger.phtml' in module: 'Magento_Ui' block's name: 'logger' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/header.phtml' in module: 'Magento_Backend' block's name: 'logo' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/admin/login.phtml' in module: 'Magento_Backend' block's name: 'admin.login' [] []
[2018-11-30 09:31:10] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/copyright.phtml' in module: 'Magento_Backend' block's name: 'copyright' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/wysiwyg/active_editor.phtml' in module: 'Magento_Ui' block's name: 'theme.active.editor' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-translation/view/base/templates/translate.phtml' in module: 'Magento_Translation' block's name: 'translate' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/components.phtml' in module: '' block's name: 'head.components' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/calendar.phtml' in module: '' block's name: 'head.calendar' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/logger.phtml' in module: 'Magento_Ui' block's name: 'logger' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/header.phtml' in module: 'Magento_Backend' block's name: 'logo' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/admin/login.phtml' in module: 'Magento_Backend' block's name: 'admin.login' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/copyright.phtml' in module: 'Magento_Backend' block's name: 'copyright' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/wysiwyg/active_editor.phtml' in module: 'Magento_Ui' block's name: 'theme.active.editor' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-translation/view/base/templates/translate.phtml' in module: 'Magento_Translation' block's name: 'translate' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/components.phtml' in module: '' block's name: 'head.components' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/calendar.phtml' in module: '' block's name: 'head.calendar' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/logger.phtml' in module: 'Magento_Ui' block's name: 'logger' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/header.phtml' in module: 'Magento_Backend' block's name: 'logo' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/admin/login.phtml' in module: 'Magento_Backend' block's name: 'admin.login' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/copyright.phtml' in module: 'Magento_Backend' block's name: 'copyright' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/wysiwyg/active_editor.phtml' in module: 'Magento_Ui' block's name: 'theme.active.editor' [] [] 
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-translation/view/base/templates/translate.phtml' in module: 'Magento_Translation' block's name: 'translate' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/components.phtml' in module: '' block's name: 'head.components' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/js/calendar.phtml' in module: '' block's name: 'head.calendar' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-ui/view/base/templates/logger.phtml' in module: 'Magento_Ui' block's name: 'logger' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/header.phtml' in module: 'Magento_Backend' block's name: 'logo' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/admin/login.phtml' in module: 'Magento_Backend' block's name: 'admin.login' [] []
[2018-11-30 09:31:11] main.CRITICAL: Invalid template file: 'C:/wamp/www/magento/theme_23_final/vendor/magento/module-backend/view/adminhtml/templates/page/copyright.phtml' in module: 'Magento_Backend' block's name: 'copyright' [] []

Any idea what is wrong?

4 Answers 4

27

Yes, This is the problem with windows. Windows uses "\" as separator, the array "directories" contains entries with "/" as separator, so the check will always fail.

So you need to fix this by replacing the separator in core file:

Magento\Framework\View\Element\Template\File\Validator

function isPathInDirectories replace below code in isPathInDirectories function

$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
9
  • This resolved the problem, thanks. I think this must be fixed in the core as fast as possible Commented Nov 30, 2018 at 13:03
  • This shouldn't be used. This is duplicating str_replace call that is written in isValid method in the same class.
    – revo
    Commented Nov 30, 2018 at 18:25
  • This is a quick fix and may be Magento will provide a patch to fix this issue. Commented Dec 1, 2018 at 11:49
  • Yes but there is a better quick fix here.
    – revo
    Commented Dec 1, 2018 at 20:50
  • @SaurabhDwivedi Which file need to edit? Which file consists $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path)); ?
    – zus
    Commented Dec 10, 2018 at 7:22
0

I have resolved this issue, yesterday on same version : run this query in your db.

INSERT INTO core_config_data (path, value) VALUES ('dev/static/sign', 0)
ON DUPLICATE KEY UPDATE value = 0;

Then run following command :

 bin/magento cache:clean 

In case if its not work you can see more solutions over here

2
  • 1
    Thanks for the response but it doesn't help me. I'm not sure that this cases are the same Commented Nov 30, 2018 at 10:55
  • I am facing the same problem. Commented Dec 31, 2018 at 8:20
0

i was trying to install a fresh Magento 2.3.5-p1 on Windows 7 32bit 2GB of RAM (and it's very out of date) using WAMPServer (php 7.1.16) and i run into unexpected MANY errors all of kind (if i could say) required js not loaded, poor performance .. all of them are specific and related to WINDOWS since Windows and MacOS are NOT OFFICIALLY supported as per this doc.. one of those errors is the one you described her and i confirm the @Saurabh Dwivedi's solution.

To work with Magento on Window with less pain and stress, it's recommanded to to use VM (link) or WSL with Windows 10 (link)

-1

This issue is from windows machine. Remove antivirus and allow firewall rules. Then add file/folders permissions. Win command: takeown /F E:/xampp/htdocs/mage23 /R

Now install magento V2.3.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.