Skip to content
Advertisement

Permission denied issue while using move_uploaded_file()

I am getting below error:

PHP Warning: move_uploaded_file(PATH_TO_FILE): failed to open stream: Permission denied in PHP_FILE

Note: I have already executed sudo chown -R apache *PATH_TO_FOLDER*. OS: Fedora 33 (Workstation Edition), PHP ver. 7.4.14.

Thanks in advance.

Advertisement

Answer

Turns out SELinux was the problem. Solved it by executing semanage permissive -a httpd_t.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement