OS: RHEL 9 with php 8.3 and httpd.
Selinux disabled.
Php Application is hosted in /var/www/html/application. Trying to upload file to /home/user/uploads.
This error showing:
move_uploaded_file(/home/user/uploads/become_a_student_inline.jpg): Failed to open stream: Permission denied
ls -Z Shows:
$ ls -Z
unconfined_u:object_r:httpd_sys_rw_content_t:s0 uploads
ls -l Shows:
$ ls -l
total 0
drwxrwxr-x. 4 ec2-user apache 35 Mar 27 10:17 uploads
Solved. Could not use
homedirectory. Createduploadsinrootdirectory and changed permissions accordingly.