Answer the question
In order to leave comments, you need to log in
How to assign permissions to delete file using php on apache2.2 server?
File deletion works from the shell, exec rm does not work from apache. (unlink too)
Answer the question
In order to leave comments, you need to log in
1. sudo
2. stackoverflow.com/questions/8532304/execute-root-c...
3. Direct buffer input when running sudo via exec: so
You just need to know from whom (user) PHP is running and set the same user as the owner of the file or add it to the required group.
https://vk.cc/5Cwljz - info from the forum.
How to properly execute exec in php? - my question and my own answer on this topic.
look in the Apache settings from which user and group it runs. This is usually www-data:www-data
folders and files must have the appropriate permissions.
the simplest option is to change the ownership of the files with
chown -R /files/directory/*
In addition to transferring rights to the Apache user, it was necessary to set the rights to the "neighboring" site in the .htaccess file
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question