I'm running PHP code with Apache on my raspberry which is a debian. My PHP files are in this folder:
/var/www/html/project
Sometimes my PHP scripts need to write in some files in this sub folder, but I get this error:
PHP Warning: chmod(): Operation not permitted in /var/www/h tml/project/vendor/launch/src/Extends.php on line 36
To correct this, I run the commande below:
sudo chmod -R 777 /var/www/html/project
After that, my PHP script has no error and it can write in the folder.
But my problem is if I run again my PHP script, I'll get the same error. So I have to re-run the same command:
sudo chmod -R 777 /var/www/html/project
What is the problem? The folder permissions change automatically after a few hours?
How do I solve this problem?