Drupal cannot create a “files” folder (and any PHP download script)

Drupal cannot create the files folder. I tried to load a php script using mkdir ("files", 774), but I get a permission error, so basically any PHP script cannot create a folder on the server ...

What are you offering? If I create the folder manually from the ftp client and I assign permission 777, everything works fine, but this is not a safe solution.

+3
source share
1 answer

You can create it manually and assign 775 as this will install it Drupal (unless you use private downloads). This should be good as a quick fix, but if your server prohibits creating directories with PHP in general, you will run into problems in the future, as many modules will want to create their own directory structures in the file folder.

Therefore, I would recommend solving the root cause, ensuring that PHP, executed from a web server context, can perform operations on files / directories inside the document root.

+1
source

Source: https://habr.com/ru/post/1738016/


All Articles