I have a strange issue with my drupal 8 installation on Ubuntu 18.4.
The Drupal Webform-module is not able to create needed directories. Therefore file upload fails.
The error occurs
- if I use the Drupal private file system (like recommended), which is for security reasons located outside of (virtual)-servers web root.
- only at the production server, not at my local development machine.
Therefore it has to be a server configuration issue.
What I have tried:
- Configuring and using public file system (located within web root): it works, but is a security risk, therefore not really a solution.
- Checked file owner and permission:
- Web server runs as php-fpm under ftp-user-account, checked with php_info().
- all files are 755 as recommended
- all files owned by the ftp-user, under which the web server runs
- Tested with chmod to 777 : no effect, still fails.
- Created needed directories by hand with terminal. This was no problem. Reaction: file upload is possible, script is able to write files there. But it ist not a solution, because the script needs creating own directories at runtime with names I cannot predict.
- Added the path to private file system to php's open_basedir directive: no difference, upload still fails, cannot create directories.
- Searching on the web found 2 other similar Questions -> I am not alone, but no one answered.
- Asked at drupal.stackexchange.com, but they say it's not a drupal but a server configuration issue.
- Is there any difference at Unix system level or for PHP between writing files (works) and creating directories (fails)?
- Is there any apache directive which makes such difference?
- Is there any php-ini variable I could check and change to make this work?