chache is not detecting source changes :(

thcom
Backer | 94
+
0
-

hi, i have a problem,
when i edit some source file presenter or template, nette dos not detect it

i should login to my server and manually delete the folder /temp/cache

because this folder have root permision i cannot delete it from my ssh connection as user

i use far manager to edit project files and i am logged as standart uses via ssh

many thanks for any advice

Tomas Holy

jiri.pudil
Nette Blogger | 1029
+
+1
-

Hello.

If you develop on a remote server, consider setting up a local development environment, it's far more convenient. On production servers, Nette does not invalidate caches automatically for performance reasons. Thus you need to delete the temp/cache directory (and possibly also clear the opcache for PHP files) as a part of the deployment process.

Second, the temp directory should definitely not be owned by root. What's your web server setup? Is it configured to run worker processes under root?

thcom
Backer | 94
+
0
-

yes, rights are the point

when i use composer create-project nette/sandbox osel

and i open it in my browser

in temp/cache folder are created folders
with those permissions

drwxr-sr-x 2 www-data tholy 4096 Dec 10 19:47 latte
drwxr-sr-x 2 www-data tholy 4096 Dec 10 19:47 Nette.Configurator
drwxr-sr-x 2 www-data tholy 4096 Dec 10 19:47 Nette.RobotLoader

i think it shold be user tholy and group www-data like other files in /var/www folder

thank you

jiri.pudil
Nette Blogger | 1029
+
0
-

In general, the temp files are created by PHP, so their owner and group is set to the owner of the PHP process. You should be able to find and edit the appropriate configuration (PHP-FPM's, or Apache's if you run PHP as an Apache module, etc.), there are directives available that set the user and group of the child processes.