Drupal: How to solve Warning: file_put_contents The file could not be created

Sometimes when migrating or setting up a local development site you may run into an error that looks like this:

Likely the Drupal temp directory isn’t writable.

An easy fix for this is to navigate to /admin/config/media/file-system
and enter the correct temporary directory or if you’re not sure what it should be, then delete the one that is entered in the field under the label “Temporary directory”. Drupal is able to detect it.

I hope this helps someone!

Leave a Reply

Your email address will not be published. Required fields are marked *