We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Problem in showing volt

Hello everyone, im havng a problem and i dont know what cause this, please help

this is what the error is when a try to access https://localhost:8080/PHALCON-BASE/currentprojects/index and other links

Warning: Phalcon\Mvc\View\Engine\Volt\Compiler::compileFile(C:\Users\spilagan20140973\Desktop\BOOTSTRAP FILES\PORTABLES\USBWebserver v8.6\root\PHALCON-BASE\app\config/../../app/cache/c__users_spilagan20140973_desktop_bootstrap files_portables_usbwebserver v8.6_root_phalcon-base_app_views_currentprojects_index.volt.php): failed to open stream: Invalid argument in C:\Users\spilagan20140973\Desktop\BOOTSTRAP FILES\PORTABLES\USBWebserver v8.6\root\PHALCON-BASE\public\index.php on line 44
Volt directory can't be written


7.3k
edited Oct '14

Seems like folder permissions not allow server to write compiled volt file in the standard referenced folder (which is the one of the volt source file), if you can't overcome the problem tweaking the permission settings you can instruct Volt to use a different folder (writable by the PHP process / server) for compiled files

$di->set("voltService", function($view, $di) {
        $volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
        $volt->setOptions(array(
            "compiledPath" => "C:/tmp/voltcachewatever",
        ));

        return $volt;
    });

PS: Generally, I suggest to keep htdocs files outside of Windows User folders which has a lot of security constraints.