Tuesday, March 27, 2018

PHP can't write to directory although it should

If PHP is not writing to a directory (e.g. you can't upload files) although all directory permissions as well as PHP and Apache settings and configuration are correct then, in case you are on CentOS 7 (or RedHat 7), the culprit may be SELinux. Just disable it or, if needed, allow writing to the directory of interest using chcon command:

To disable SELinux

To resolve the issue with SELinux enabled

No comments:

Post a Comment