0

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.

Matej
  • 1
  • 3
  • Welcome to SO! Please post the relevant code :-) Only the error does not tell us enough to be able to help you. – Alexander Dobernig Jan 25 '21 at 15:17
  • 1
    whats your output of `ps aux | grep -i 'apache\|httpd' ` ? – tinker Jan 25 '21 at 15:24
  • @tinker can't paste all the lines so here are some of them:
    apache 1042 0.1 0.2 472148 21184 ? S Jan24 1:46 php-fpm: pool www
    root 44020 0.0 0.1 35504 9816 ? Ss 15:42 0:00 /usr/sbin/httpd -DFOREGROUND
    apache 44021 0.0 0.0 46708 5452 ? S 15:42 0:00 /usr/sbin/httpd -DFOREGROUND
    matej 45697 0.0 0.0 221564 2608 pts/0 S+ 17:09 0:00 grep --color=auto -i apache\|httpd
    – Matej Jan 25 '21 at 16:44
  • might be selinux see https://fedoraproject.org/wiki/SELinux/apache – tinker Jan 25 '21 at 18:40
  • @tinker turns out SELinux was the problem. Solved it by executing `semanage permissive -a httpd_t`. Thank you so much! – Matej Jan 25 '21 at 19:48

1 Answers1

0

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

Matej
  • 1
  • 3