Question

When i am installing magento 2.2.7 in my local dev window system using wamp, Than i getting

1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'D:/wamp64/www/newcheckout/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js'

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'D:/wamp64/www/newcheckout/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js'
#0 D:\wamp64\www\newcheckout\vendor\magento\framework\View\Element\Template.php(300): Magento\Framework\View\Element\Template->fetchView('D:/wamp64/www/n...')
#1 D:\wamp64\www\newcheckout\vendor\magento\framework\View\Element\AbstractBlock.php(667): Magento\Framework\View\Element\Template->_toHtml()
#2 D:\wamp64\www\newcheckout\vendor\magento\framework\View\Result\Page.php(248): Magento\Framework\View\Element\AbstractBlock->toHtml()
#3 D:\wamp64\www\newcheckout\vendor\magento\framework\View\Result\Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#4 D:\wamp64\www\newcheckout\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#5 D:\wamp64\www\newcheckout\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#6 D:\wamp64\www\newcheckout\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#7 D:\wamp64\www\newcheckout\generated\code\Magento\Framework\View\Result\Page\Interceptor.php(130): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#8 D:\wamp64\www\newcheckout\vendor\magento\framework\App\Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#9 D:\wamp64\www\newcheckout\generated\code\Magento\Framework\App\Http\Interceptor.php(24): Magento\Framework\App\Http->launch()
#10 D:\wamp64\www\newcheckout\vendor\magento\framework\App\Bootstrap.php(257): Magento\Framework\App\Http\Interceptor->launch()
#11 D:\wamp64\www\newcheckout\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#12 {main}

No correct solution

OTHER TIPS

I got solution after ,

> vendor\magento\framework\View\Element\Template\File\Validator.php

Than Line 139

if (0 === strpos($path, $directory)) {

Thanks

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));

Reference : https://magento.stackexchange.com/a/251985/81177

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top