I'm facing very strange behaviour on Drupal 8.8.5, CentOS Linux release 7.5.1804, PHP 7.2.19 and HTTPD - Apache/2.4.6
Basically, after updating to 8.8.5 (that has been a real headache), the system throws errors while flushing css+js files on "flush caches".
Drupal\Core\File\Exception\FileException: Failed to unlink file 'public://css/css_Y3zRgmC0P7yIXk_w_H9qyrPs3aMkKRv44SMfupbSCMc.css.gz'. in Drupal\Core\File\FileSystem->delete() (line 340 of/var/www/html/project/core/lib/Drupal/Core/File/FileSystem.php).
Warning: unlink(/var/www/html/project/sites/default/files/css/css_Y3zRgmC0P7yIXk_w_H9qyrPs3aMkKRv44SMfupbSCMc.css.gz): Permission denied in Drupal\Core\File\FileSystem->unlink() (line 124 of /var/www/html/synergie/core/lib/Drupal/Core/File/FileSystem.php)
This obviously leads to bad frontend and admin panel behaviour.
I've literally tried to do everything I could, by:
- Setting all 777 to /var/www/html/project/sites/default and subdirectories
- Changing owner of the directory aforementioned
- Manually debugging lines 124 and 340 of lib/Drupal/Core/File/FileSystem.php
What I've found very strange, is that by manually debugging the unlink method on FileSystem.php, it lead to some strange results:
public://css/css_Y3zRgmC0P7yIXk_w_H9qyrPs3aMkKRv44SMfupbSCMc.css.gz: readable and writable
/var/www/html/project/sites/default/files/css/css_Y3zRgmC0P7yIXk_w_H9qyrPs3aMkKRv44SMfupbSCMc.css.gz: readable but not writable
Some notes: - Httpd runs on apache user and apache group
I've tried to do every possible combination of folder and write permission and owner and group to every directory and child subdirectories of /var/www/html/project/sites/
I've already tried to follow these instructions: Web Archive
I've also run this "folder and file permissions script": Drupal Website
Do you have ideas or suggestions? I cannot go past this one
apache
, setting folders to700
and files to600
should work (not code. files in your files directory) – rovr138