aneuryzm
aneuryzm

Reputation: 64834

Drupal is unable to create the "files" folder (and any upload php script as well)

Drupal cannot create the "files" folder. I tried to upload a php script with mkdir("files",774) but I get a permissions error, so basically any php script is not able to create a folder on the server...

What do you suggest ? If I create the folder manually from ftp client and I assign 777 permission everything works perfectly, but it is not safe solution.

Upvotes: 3

Views: 1803

Answers (1)

Henrik Opel
Henrik Opel

Reputation: 19441

You can create it manually and assign 775, as that would be how Drupal would set it (except if you use private downloads). As a quick fix, this should be OK, but if your server disallows directory creation from PHP in general, you'll face trouble down the road, as many modules will want to create their own directory structures within the files folder.

So I'd recommend solving the root cause, ensuring that PHP executed from within the webserver context can do file/directory operations within the document root.

Upvotes: 1

Related Questions