1

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}
0

I got solution after ,

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

Than Line 139

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

Thanks

  • Is it working fine for you? – Prema Karthik Dec 16 '18 at 16:26
  • yes this one is working fine for me. – Impunkj Dec 17 '18 at 4:51
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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