Just transfered my first Drupal site to my Hostmonster account, to see if it would actually work.... and no.

It kind of works. I am using the Bartik theme with only minor adjustments from default (a little color change basically it).... but the page displays with no color and no images (eg: nothing over the menu tabs, no header color, no footer color). So I go to appearances and try to change up the colors, and when I click save it responds with the following error:

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 /home1/toefltes/public_html/new/includes/file.inc).
Warning: file_put_contents(temporary://fileUn0xkH) [function.file-put-contents]: failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1847 of /home1/toefltes/public_html/new/includes/file.inc).
The file could not be created.

As I said, I am new to Drupal, so I dont really get the information in the error message. I called Hostmonster and double checked myself, and all files uploaded properly and none are broken. I think the settings.php file is fine for the database, but here is the line 181 stuff:

$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'toefltes_new',
'username' => 'yyyyyyyy',
'password' => 'xxxxxxxx',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);

So any insight would be apprecitated.

Also, follow up question. Can anyone recommend the best hosting solution with good Drupal support. Hostmonster basically told me to go pound sand. They dont know Drupal, and can't help with it.

Ryan

Comments

eldamar’s picture

I have the same problem, also new to drupal

Edit: The answer to this issue solved this error for me https://drupal.org/node/1053896 but i still can't access my site, only the administration is accessable.

Now i get "Warning: domdocument::domdocument() expects at least 1 parameter, 0 given i filter_dom_load() (row 1042 of D:\xampp\htdocs\homepage\modules\filter\filter.module)."

brynetzster’s picture

Thanls for the link above, my problem solve, perfect..thank you so much

dianacastillo’s picture

I had run update without putting drupal in maintenance mode.
once I put it in maintenance mode, ran update again , the problem disappeared

Diana Castillo

Tharick’s picture

Works good for me :)

gregor171’s picture

file_put_contents(temporary://filennnnn): failed to open stream translates simply to: can not write file to a disk! Either there is no temp folder or Drupal doesn't have enough permission for writing in that folder.

What you need to do is either change temp folder (at your-url/admin/config/media/file-system) to
sites/default/files/temp
or
sites/your-site/files/temp
or
change write permision to current temp folder (so that Drupal can write to it)

philalonso’s picture

After creating a local instance of a site that required work, I received this error. A Google search provided this Drupal.org issue queue with Gregor's solution. Thank you, Gregor!

ejazrus’s picture

I moved the site to a new development computer having document root present on drive with drive letter different from the original and i was greeted with DrupalTemporaryStreamWrapper::stream_open and FTP related messages while trying to install a module using URL method (after enabling devel). I suspected windows permissions issue at first but nothing I did solved my issue.
I'm glad I stumbled upon this post and fixed the tmp directory in my-url/admin/config/media/file-system
Big thanks to you, Gregor171 :D

kennybell’s picture

Also worked for me, just changing the temp path in "admin/config/media/file-system"

Thanks!

ellastelter’s picture

This did the trick for me!

I was trying to set up a proper workflow using Pantheon and Acquia Dev Desktop for a Panopoly site I had been working on. There are a lot of unknowns for me as I learn, so I am glad the solution was so simple.

Oksana Skotar’s picture

It worked! 

bufflex’s picture

This worked for me as well. Apparently my temp folder was pointing to some folder on my localhost. After changing the path to sites/default/files/temp and clearing the cache, my problem was fixed. Using Drupal version 8.6.5 and running on php 7.2

Omar79’s picture

thanks! worked for me

ehsankhfr’s picture

It worked for me!

Drupal version: 7.x

flavio_tito’s picture

Warning: file_put_contents(temporary://fileo1vz2A): failed to open stream: "DrupalTemporaryStreamWrapper::stream_open" call failed in file_unmanaged_save_data() (line 1859 of /hsphere/local/home/pluswebdes/professor.yellowtangerine.com/includes/file.inc).
The file could not be created.

flavio_tito’s picture

Maybe you just haven´t created a 'files' folder at 'sites/default' or must set properly the temporary directory at file system (admin/config/media/file-system).

let me know!

swfindlay’s picture

Thanks flavio_tito - I hasd exactly this problem and your solution worked perfectly. I had to create a new tmp folder (as am on a shared hosting server) and then pointed Drupal to the write place.

Thank you!

flacoman91’s picture

just wanted to say thanks because your tips helped me out a lot! I migrated stuff over from shared hosting to a linode vps and I didn't create the files directory yet.

Also going to the file system configuration fixed things.

almostengr’s picture

This helped me out in my installation as well.

My Drupal environment moved from Windows to Linux and the directory naming is completely different, which was causing errors.

bbopp’s picture

Flavio - your answer is still helping! Many thanks!

a.knutson’s picture

Thanks!

aqmaster’s picture

Gracias!, ese era el problema, había cambiado de Driver mi disco duro, por lo que debía cambiar la ruta del tmp desde el admin.

iXed’s picture

I had the same problem, and i went to the sites/default/files folder and gave 433 permission to the .htaccess file and now it works without the error.

Hope it helps.

droweski’s picture

You can view the current tempdir location at admin/config/media/file-system
But you can only change it in settings.php

marcinsdance’s picture

In my case I just had to click "save" in admin/config/media/file-system - and this solved it.
Cheers

a.knutson’s picture

Thanks so much for mentioning that sometimes it just needs to be re-saved. This fixed my issue!

rahuldolas123’s picture

hey @marcinsdance, it worked like a charm.
thank you.

waqarit’s picture

I have also done the same thing and work like a charm, thanks

bajah’s picture

Thanks flavio, the 2 pointers did the trick

suntog’s picture

thankyou, I was about to nuke my site

DiogenesTheCynic’s picture

I just found this after a week of frustration - Drupal still doesn't check for the tmp directory. Sigh.

rccastilla’s picture

I had the same error y solved the warning was accessed http://server/xampp/.../es/admin/config/media/file-system and change the location of the temporary directory: opt / lampp / tmp
After he was given full permission to the folder opt / lampp / htdocs / xampp / .. / sites / default / sites and opt / lampp / tmp
Note: recursive permission 0777 to the folder files.

batigolix’s picture

Note (to myself) that if you have the module Journal enabled, you need to add a message to the journal textfield. Otherwise the new file folders are not saved. (Error messages are hard to read when the themes are not loading)

TWD’s picture

Changing

/tmp

to

tmp

at /admin/config/media/file-system
worked for me. i.e. remove the leading slash and save.

See thread:
https://drupal.org/node/1106492

zooter626’s picture

(*sigh) thank you! that's what did it for me!

Claudiu Arbanas’s picture

Give write permissions to temp folder from "sites->default->files".

It can be found as "tmp".

If there is no temp folder, create it.

vivdrupal’s picture

The temp directory was still pointing to the local wamp directory.
Corrected it to /temp to solve.

sarathkm’s picture

Thanks. was able to add tmp directory using drush.
http://drupal.stackexchange.com/questions/50765/how-to-change-tmp-direct...

sobi3ch’s picture

On Ubuntu I've change first from sites/default/files/tmp > system /tmp then back to sites/default/files/tmp and this solve issue for me. So I'm assuming there is some bug in this DrupalTemporaryStreamWrapper::stream_open method or in PHP itself.

klequis’s picture

Also on Ubuntu

The answer for me as well was in /admin/config/media/file-system

1) The path I had for 'Private file system path' did not exist. I'm not sure if this mattered as the error said it was trying to write a temporary file so ...
2) ...this was probably the problem, the path in 'Temporary directory' did not exist. changing it to /tmp solved the problem. I know someone else had a problem with the leading '/' but leaving it there worked for me.

r2coder’s picture

Thanks gregor171 - checking the files system configurations turned out to be the issue for me. When I imported the test database - this configuration was set for the file system for a MAC; I am running CentOS.

Saved me some troubleshooting time :-)

/r

john@jronmorgan.com’s picture

This was from a bad Temporary directory value in admin/config/media/file-system

I tried over and over again to update the value using the UI but it would not save. So, I just updated it directly in the database:

drush sql-cli
update variable set value = 's:8:"/mnt/tmp"' where name = 'file_temporary_path';

set the 's:8:"/mnt/tmp"' to whatever it is that you need...

you could probably use a straight drush command to set it as well but I was tired of fighting with it.

FIXED. DONE..

knalstaaf’s picture

This helped me out…

aryashreep’s picture

I have updated the Temporary directory in "/admin/config/media/file-system" and it works for me. Make sure your "tmp" folder have read and write permission.

OS: Win 10
Drupal 7
Drush 6