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

Volt directory can't be written

The error I am getting is

Volt directory can't be written

#0 [internal function]: Phalcon\Mvc\View\Engine\Volt\Compiler->compileFile('/home/derandi/P...', '/home/derandi/P...', false)
#1 [internal function]: Phalcon\Mvc\View\Engine\Volt\Compiler->compile('/home/derandi/P...')
#2 [internal function]: Phalcon\Mvc\View\Engine\Volt->render('/home/derandi/P...', Array, true)
#3 [internal function]: Phalcon\Mvc\View->_engineRender(Array, 'index/index', true, true, NULL)
#4 [internal function]: Phalcon\Mvc\View->render('index', 'index', Array)
#5 /home/derandi/Project/Kursus/Website/test1/public/index.php(37): Phalcon\Mvc\Application->handle()
#6 {main}


1.9k
Accepted
answer

Try to chmod it to 777 and see if that help



85.5k

with which user is your php runing ? if its www-data and you (derandi) is the owner of the files, you can 664 the folder and the files.

https://www.onlineconversion.com/html_chmod_calculator.htm

ll volt_compile_directory

ll volt/
total 260
drwxrwxr-x  2 izo www-data  4096 Jan 20 23:08 ./
drwxrwxr-x 16 izo www-data  4096 Jan 17 09:38 ../
-rwxrwxr-x  1 izo www-data    14 Oct 14 08:09 .gitignore*
-rwxrwxr-x  1 izo www-data  1108 Jan 22 10:56 %%var%%www%%......%%cli%%emails%%common%%_footer.volt.php*
-rwxrwxr-x  1 izo www-data  4324 Jan 21 14:56 %%var%%www%%.....%%cli%%emails%%order%%invoice.volt.php*

and i am uploading my files with "izo" user. so my izo user needs to be able to write on those files. so the owner has to be 6. now in order your php to be able to re-create the template file it needs to be 6 also, and for others ( the 3rd number ) whatever you deside.



2.6k

Try to chmod it to 777 and see if that help

thanks :D its working now



2.6k

with which user is your php runing ? if its www-data and you (derandi) is the owner of the files, you can 664 the folder and the files.

https://www.onlineconversion.com/html_chmod_calculator.htm

ll volt_compile_directory

ll volt/
total 260
drwxrwxr-x  2 izo www-data  4096 Jan 20 23:08 ./
drwxrwxr-x 16 izo www-data  4096 Jan 17 09:38 ../
-rwxrwxr-x  1 izo www-data    14 Oct 14 08:09 .gitignore*
-rwxrwxr-x  1 izo www-data  1108 Jan 22 10:56 %%var%%www%%......%%cli%%emails%%common%%_footer.volt.php*
-rwxrwxr-x  1 izo www-data  4324 Jan 21 14:56 %%var%%www%%.....%%cli%%emails%%order%%invoice.volt.php*

and i am uploading my files with "izo" user. so my izo user needs to be able to write on those files. so the owner has to be 6. now in order your php to be able to re-create the template file it needs to be 6 also, and for others ( the 3rd number ) whatever you deside.

thanks Izo :D i have fix the problem

Izo posted a better solution. Setting chmod 664 is much more secure than giving all permission to everybody. Be aware of setting 777 chmods

with which user is your php runing ? if its www-data and you (derandi) is the owner of the files, you can 664 the folder and the files.

https://www.onlineconversion.com/html_chmod_calculator.htm

ll volt_compile_directory

ll volt/
total 260
drwxrwxr-x  2 izo www-data  4096 Jan 20 23:08 ./
drwxrwxr-x 16 izo www-data  4096 Jan 17 09:38 ../
-rwxrwxr-x  1 izo www-data    14 Oct 14 08:09 .gitignore*
-rwxrwxr-x  1 izo www-data  1108 Jan 22 10:56 %%var%%www%%......%%cli%%emails%%common%%_footer.volt.php*
-rwxrwxr-x  1 izo www-data  4324 Jan 21 14:56 %%var%%www%%.....%%cli%%emails%%order%%invoice.volt.php*

and i am uploading my files with "izo" user. so my izo user needs to be able to write on those files. so the owner has to be 6. now in order your php to be able to re-create the template file it needs to be 6 also, and for others ( the 3rd number ) whatever you deside.