Just installed version 7. every time i change the colour of a theme there are error messages as follows

Error message•Warning: file_put_contents(temporary:///.htaccess) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_create_htaccess() (line 507 of /home/spratcom/public_html/drupal-7.0/includes/file.inc).
•Warning: file_put_contents(temporary://filegFNRtf) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1847 of /home/spratcom/public_html/drupal-7.0/includes/file.inc).
•The file could not be created.

I would appreciate it if someone could help me understand why this is happening

Comments

superitgel’s picture

I had the very same problem. It has a simple solution. Go to
Home » Administration » Configuration » Media
and fix temporary directory.

When I moved my site to a different server the path to temp was changed. And it needs to be updated.
In my old server it was c://wamp/tmp, but in new server it became d://wamp/tmp

Julia_yl’s picture

perfect !!!

webzucht’s picture

Changed the rights to sites/default/files to 644 and it worked too.

swfindlay’s picture

Same problem - this worked perfectly. Thanks superitgel

haloola’s picture

that has solved must of my problems ,but am still facing clean url problem since ihave migrated my drupal site from apache to iis6

Powergird’s picture

A big thanks, it really helped me。。well done,thanks again

jeril842002’s picture

A big thanks, it really helped me.

One more point I would like to make here.
My drupal code was in /public_html, I created a temp folder in /public_html

Then in the temporary directory you mentioned above, I just specified "temp".

rsutaria’s picture

perfect solution. thanks!

generalelektrix’s picture

Almost there, but on Windows 2008 R2 with IIS, I had to add a folder with write access to IUSR somwhere on the file system and add this path in Configuration >> Media >> File system >> Private file system path.
Thank you!

goofken’s picture

Thanks

cswan’s picture

Thank you so much!!!

ss54’s picture

Than you so much, I also benefited from this post.

Abhimanyu Bose’s picture

Thanks you for providing the solution.
It was really helpful

zafir’s picture

Thanks a lot.

loopy1492’s picture

Worked for me. I used sites/all/files/temp

rangi500’s picture

Thanks!

vitaliyb98’s picture

Thanks!

shobhit_juyal’s picture

it helps !

douglasbeale’s picture

Worked great for me too!

SohelPathan’s picture

Yes. The issue was in the settings of the "Temporary" and "Private" directory path. It was incorrect and giving an error. Now it is resolved.

Lots many THANKS. You saved my day.

robertcfi’s picture

changing sites/default/files folder to 644 was easiest fix!

toulon’s picture

I found this to be an better choice as 666 did not remove my warning message.
chmod 755 sites/default/files

brynetzster’s picture

Many thanks.. my problem has solve.. perfect answer.. thanks

Charl23’s picture

Thank you... you saved me...

drooperNZ’s picture

I made a temp folder as described. I'm working locally. IT WORKED.

Went to Home » Administration » Configuration » Media

I made this: sites/all/themes/theme656/temp

.....as the theme I'm using is called theme656

movieman7’s picture

I've only started building a Drupal site within the past week.

I've been trying to determine if it's a permission issue, or the .htaccess file is in the wrong location ... or both.

I have a specific directory setup within public_html where the Drupal files are located.

The .htaccess file is on the root of this specific directory.

Within the Administration panel: Home » Administration » Configuration » Media

I set the "Public file system path" to: sites/default/files/tmp

No "Private file system path" set.

The temporary directory is set to: /tmp

Note: I'm not sure what each Permission code does. I've tried different ones to no avail.

I saved the configuration and receive the same double error.

Help ...

jaypan’s picture

The fix is listed earlier in the thread.

Contact me to contract me for D7 -> D10/11 migrations.

solomonkitumba’s picture

this command solved the issue for me
sudo chmod -R 777 sites/default/private/

ss54’s picture

Your post was great and I benefited from it

rick3455’s picture

Thanks a million...

asyadrupal7’s picture

it work perfectly, be blessed!!

priyanka12chavan’s picture

perfect solution, thanks.

igiekhume’s picture

Thanks bro my problem solved