How to assign rights to delete the file using php on apache2 server.2?

From Shelah file deletion triggered from apache is not running exec rm. (unlink, too)
July 4th 19 at 23:23
4 answers
July 4th 19 at 23:25
Solution
1. sudo
2. stackoverflow.com/questions/8532304/execute-root-c...
3. Direct input to the buffer when running sudo via exec: so
added to sudoers does not help - Shanny_Medhurst commented on July 4th 19 at 23:28
: check the right file and the right process - nothing more to say. - Kyleigh_Hills commented on July 4th 19 at 23:31
July 4th 19 at 23:27
You just need to know who (user) and PHP runs the same user to put in the owners of the file or add to the group.
https://vk.cc/5Cwljz - infa from the forum.
How to run exec in php? - my question and my answer on this topic.
Complement the answer, the author of the question it would be nice to see how php is executed by Apache in his case petrenco.com/php.php?txt=91 - Shanny_Medhurst commented on July 4th 19 at 23:30
July 4th 19 at 23:29
look in the settings of Apache what user and group it runs. Usually it is www-data:www-data
the folders and files needs to be a corresponding law.

the easiest way is to change the owner of files using
chown-R /files/directory/*
July 4th 19 at 23:31
In addition to the transfer of rights to the Apache user, you need to configure rights at the neighboring site in the file .htaccess

Find more questions by tags ApachePHP