when you must use an alternate TMP dir for drupal, drush wont use it.

drush dl views
Project views (7.x-3.0-beta3) downloaded to                          [success]
/home/expresso/d7/sites/all/modules/views.
Project views contains 3 modules: views_export, views, views_ui.
WD php: Warning: file_put_contents(/tmp/cache.inc): failed to open   [warning]
stream: Permission denied in drush_pm_put_extension_cache() (line
2419 of /home/expresso/drush/commands/pm/pm.drush.inc).
file_put_contents(/tmp/cache.inc): failed to open stream: Permission [warning]
denied in drush_pm_put_extension_cache() (line 2419 of
/home/expresso/drush/commands/pm/pm.drush.inc).
expresso@expressogalz.com [~/www/cms]# 

Comments

moshe weitzman’s picture

Status: Active » Closed (works as designed)

setup your desired tmp dir in php.ini, and not just drupal. we can't rely on drupal for this as we don't bootstrap for many requests.

jwilson3’s picture

Status: Active » Closed (works as designed)

I ran into this issue on a shared hosting environment. It turned out that /tmp/cache.inc file was previously created by a different user, and so I couldn't delete or change the file.

Unfortunately, my attempts to customize the tmp directory location using ini_set('upload_tmp_dir') failed; I tried adding the line to both drushrc.php and at the top of the drush.php executable to no avail.

I've contacted the hosting support about the issue as well.

UPDATE: the hosting provider deleted the file for me, but this doesnt mean that it wont happen for somebody else later on the server.

jwilson3’s picture

Status: Closed (works as designed) » Active

@moshe:

What is drush's stance on supporting shared hosted environments?

Should drush at least check to see if a file exists / has permission before it writes to a shared temp location?

greg.1.anderson’s picture

Status: Closed (works as designed) » Active

While I did not re-check to verify that drush handles /tmp correctly in all other places, the specific symptom described here was caused by a tragic bit of code that was never really finished and should not have been committed in the first place. It was backed out of 5.x-dev in #1049660: remove hardcoded drush pm extension cache, and is waiting to be backported to 4.x-dev.

greg.1.anderson’s picture

Until 4.5 is available, as a workaround, if you are working in a shared environment, create /tmp/cache.inc and make it world-writable. Then get something strong to wash the bad taste out of your mouth with. (Sorry, this one was mine.)

jwilson3’s picture

LOL. thanks for the follow up, and the laugh.

q0rban’s picture

subscribe

greg.1.anderson’s picture

Status: Active » Closed (duplicate)

Closed as duplicate per #4. Re-open if symptoms do not clear up after other patch applied.