I have a website powered by php on centos 7 and this website has methods for upload and delete file in the centos’ "/var/www/html/uploadfile" directory. PHP’s "move_uploaded_file" method and "unlink" method was not working before but I connecting centos with ssh and i write in terminal:
chcon -R -t httpd_sys_rw_content_t /var/www/html/uploadfile
sudo chmod -R 777 /var/www/html/uploadfile
chmod a+rwxt /tmp /var/www/html/uploadfile
and "move_uploaded_file" method is working succesful now. But "unlink" method still not working.
I will say one more thing, "uploadfile" folder’s owner is root, but uploaded file’s owner is apache. Could it be because of this situation?
(This methods was working succesfully in my localhost. I think my problem is about centos’s file-permissions.)
2
Answers
Ok fine, my code:
And I say it again; I'm sure the problem isn't in my code. Because this code working succesfully in my localhost. I think this problem is indeed with file perms.
put your code to check it
without your code nobody can solve your problem