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?

up vote 6 down vote accepted

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));
  • This resolved the problem, thanks. I think this must be fixed in the core as fast as possible – Alexander Grosul Nov 30 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 Nov 30 at 18:25
  • This is a quick fix and may be Magento will provide a patch to fix this issue. – Saurabh Dwivedi Dec 1 at 11:49
  • Yes but there is a better quick fix here. – revo Dec 1 at 20:50
  • @SaurabhDwivedi Which file need to edit? Which file consists $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path)); ? – zus Dec 10 at 7:22

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

  • Thanks for the response but it doesn't help me. I'm not sure that this cases are the same – Alexander Grosul Nov 30 at 10:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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