7

I recently tried to move my Drupal site to a new server using this page: Moving Drupal 7 site to a new server.

But now the style doesn't seem be loaded and more importantly I get this error on every page in the site (even on the frontpage):

Warning: file_put_contents(temporary://filef76T9k): failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1900 of /Library/Server/Web/Data/Sites/Default/drupal/includes/file.inc).

The file could not be created.

Any ideas what this could be about?

2 Answers 2

8

It sounds like your temp directory is either wrong, or isn't writable.

Visit "admin/reports/status" and fix any problems that are there.

Then visit "admin/config/media/file-system" and make sure the temp directory is set properly and is writable by the webserver.

4
  • If you're unsure what the temp directory should be set to, you can just delete what is in there and click Save configuration and Drupal is usually pretty good at picking up the right one. Jun 14, 2012 at 16:12
  • is there a way that i can do that though the terminal because apparently i cant login yet am also facing the same error
    – user23321
    Oct 31, 2013 at 11:55
  • @solomonkitumba You can try it as drush st, but I am not sure if that will help in your case.
    – mpdonadio
    Oct 31, 2013 at 11:59
  • you can create a tmp file inside your /sites/default/files/ then should specify it in the media/file-system ->
    – harikris
    Jun 25, 2014 at 7:46
0

The error happens, because your temporary directory is not writable by your web server user.

You may check that in admin panel by going to Reports and Status report at: /admin/reports/status.

To fix it, you've to got to File system in Configuration, then change your temporary directory to point to your writable directory. If that's correct, then make you set the right permission on it, e.g.

sudo chmod 777 /tmp

and the same for default files folder:

sudo chmod -R 777 sites/default/files

If you're using drush, check which folder is set currently by:

drush vget file_temporary_path

Then to fix it, try:

drush vset file_temporary_path /tmp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.