Volt directory can't be written.


The error I am getting is

html Warning: Phalcon\Mvc\View\Engine\Volt\Compiler::compileFile(../app/views/index/index.phtml.php): failed to open stream: Permission denied in /Users/mattstephens/Sites/magpie/public/index.php on line 26 Phalcon Exception: Volt directory can't be written

I have declared the volt engine usage in my bootstrap like so

      '.phtml' => 'Phalcon\Mvc\View\Engine\Volt'

The mention of line 26 in my code points to the application handle function shown below

echo $application->handle()->getContent();```

Is this a permissions related thing or due to a missing directory?

I got the answer i need on stack overflow.

Basically if you don't specify where Volt can save it's compiled files it uses the directory the view file is located in.


share link

Thanks for sharing the link and for giving me the right answer :)