Download & Extend

D7 Manual Webhost Install Errors from "/tmp" - the default "Temporary directory" in "Media: Filesystem" - Solution.

Project:Drupal core
Version:7.0
Component:file system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)
Issue tags:error, errors, Permission denied in drupal_mkdir(), permission denied tmp, tmp file, Warning: mkdir() [function.mkdir], Warning: rmdir(/var/tmp/update-extraction, Warning: unlink(/var/tmp/update-cache

Issue Summary

The default specification of "/tmp" at
"Configuration" > "Media: File system": "Temporary directory"
can cause errors with manual webhost installations of Drupal 7.

===

Sample Errors:

---

With module "Update manager" enabled:

Warning: unlink(/var/tmp/update-cache/skinr-7.x-2.x-dev.tar.gz) [function.unlink]: Permission denied in drupal_unlink() (line 2139 of /home1/greatgr2/public_html/a-a-a-a/includes/file.inc).
...
Warning: rmdir(/var/tmp/update-extraction/skinr/tests/skins/example) [function.rmdir]: Permission denied in drupal_rmdir() (line 2277 of /home1/greatgr2/public_html/a-a-a-a/includes/file.inc).

---

When trying to "Install from a URL"; even with the "Update manager" UN-enabled:

Warning: mkdir() [function.mkdir]: Permission denied in drupal_mkdir() (line 2244 of /home1/greatgr2/public_html/0000/g/includes/file.inc).
The directory /tmp-test-del-hi_blue_host_tech does not exist and could not be created.

===

The solution is to rename "/tmp" and "Save configuration"
and see whether or not you immediately get errors.

Examples:

/tmp2 (this location did not work for me, but the following all did)
/tmp3
/tmp-hi_blue_host_tech

If you recieve no errors upon clicking the "Save configuration" button
then your troubles are over. If so, try another name.

I highly recommed leaving the beginning slash "/"
in front of whatever name you choose so that
the temporary files directory location will be created
at a level two parents higher than your online public_html directory.

If you do fail to use the slash at the beginning,
the directory will be created inside of your D7 root folders
as in using "tmp" will result in the creation of
public_html/[d7-root]/tmp and at that location files will accumulate
and require you to delete them manually if you want to get rid of them
and they serve no purpose
except to use up disc space uneccessrily.

===

Note: Re: A SimpleScripts' installation default "Temporary Directory" location:
/home1/greatgr3/public_html/[d7-root]/tempdir
..and at this location files accumulate and require manual deletion.

===

Do not use "~" as "Temporary Directory" location:

My original recommendation of simply adding
a "~" character in front of D7's default of "/tmp"
in the field-box "Temporary directory"
at "Configuration" > "Media: File system"
causes D7 to create your temporary D7 folder
in your site's folders
at [d7-root]/~/
.

Additionally, and more importantly,
if you try to delete those unwanted files
using an FTP program,
you may, like me, find that trying
to navigate into ANY folder named "~"
on your wbhost site using FTP,
causes you to be immediately taken
to your website's root folder—
which is to say that you can not access those
temporary files using FTP to delete them.
and you will have to delete the temporary files
via your webhost's Control Panel (CPanel).

===

My notes:

- This problem only occured at one of my two different BlueHost.com
accounts although they differ only in domain name (both are basic $6.95/mon.)

- I gave midnight tech at bluehost access to my D7 "Reports" page
and asked if he could tell me what difference
he might see between my two host accounts
but he could not easily establish why one site would have had problems
while the other one did not.

- While testing possible "Temporary directory" choices,
"/tmp" did finally get accepted and I am using it now error free
including that I get no errors immediately post-installation
when I leave 'Check for updates Automatically' enabled during install.

- The successful acceptance of "/tmp" happened at a time just few seconds
after I noticed the my FTP program had just hung.

Comments

#1

2011.06.06 - Ignore the above; I can Not edit the post above.

===============

All you really need to do if you are having problems is to remove the forward-slash ("/") from "/tmp"
and specify

tmp

only at --> [Your-D7-root-home] » Administration » Configuration » Media: File system » Temporary directory.

Please see Comment #11 below for additional details

[Although an additional alternative to comment #11 is for you to
install Drupal 7 via your WebHost's "SimpleScripts"
or other automated-script-installation free service. See
"Install Drupal 7 in one-minute (or Drupal 6)"
http://drupal.org/node/1105616 Tutorial.]
.
.
.
2011.06.06 DELETED erroneous suggestions
.
.

#2

Issue tags:+tmp file

Hi,
I'm having this issue at install of Drupal 7.

•Warning: unlink(/tmp/update-cache/transliteration-7.x-3.0-alpha1.zip) [function.unlink]: Permission denied in drupal_unlink() (line 2141 of /home/charl145/public_html/onewomanbiz/includes/file.inc).
•Warning: unlink(/tmp/update-cache/languageicons-7.x-1.0-beta1.zip) [function.unlink]: Permission denied in drupal_unlink() (line 2141 of /home/charl145/public_html/onewomanbiz/includes/file.inc).
•Warning: unlink(/tmp/update-cache/token-7.x-1.0-beta1.zip) [function.unlink]: Permission denied in drupal_unlink() (line 2141 of /home/charl145/public_html/onewomanbiz/includes/file.inc).
•Warning: unlink(/tmp/update-cache/views-7.x-3.0-alpha1.zip) [function.unlink]: Permission denied in drupal_unlink() (line 2141 of /home/charl145/public_html/onewomanbiz/includes/file.inc).

...etc creates an unterminable scrolling page and then congratulates me on successful installation of Drupal 7. Huh??? What the ???
Anyway, I tried to change /tmp to /tmp2 in file.inc but it doesnt change anything.

Are there more places/ files I need to change the name of the tmp file?

I would really like to get past installation...the famous Drupal 7 one minute installation mentioned somewhere here, seems rather utopic at this point.

#3

Issue tags:+permission denied tmp

Found it inside drupal 7 admin control panel in configuration. changed to tmp/temp sucessfully.
Hope this is useful to others.

#4

Status:active» closed (duplicate)

Duplicate of #1008328: Uniqueify update-cache and update-extraction directories to prevent "Permission denied" errors. Thanks for your reports.

#5

@onewomanbiz:
.
Re: One-Minute Drupal Install.
.
If your webhost provides "SimpleScripts"
(As most major commercial WebHosts do)..
.
Then you can install either Drupal 6 or Drupal 7
in 41 seconds. I did,
and all I know how to do is use a keyboard, mouse, and
"Copy" / "Paste".
.
The route to auto-install D7 or D6 in one-minute is..
.
Webhost > Control Panel (CPanel) > Simple Scripts > Drupal > 7 (or 6).
...
..
.
"Follow your nose: It always knows."
.
.
.
My "Rough Draft" tutorial to a one-minute-or-less
D6 or D7 install is at.. http://drupal.org/node/1105616
.
.
.
If you are seeking an online webhost for your site,
that you can be sure is "Drupal friendly", go to
http://drupal.com (Yes that site is affiliated with this drupal.org site)
and click on one of the webhosting provider links there
and you will be helping to support the Drupal cause
as well as your getting a webhost for less than $4 USD per month.
###

#6

Title:Webhost Install Errors from "/tmp" - the default "Temporary directory" in "Media: Filesystem" - Solution.» D7 Manual Webhost Install Errors from "/tmp" - the default "Temporary directory" in "Media: Filesystem" - Solution.

#7

Okay, maybe I'll try installing D7 through automated hosting scripts. Thanks for the tip.

#8

That tip, my friend, is my pleasure.

I was shocked the other day to see that
SimpleScripts was D7 ready.

Given my concern for New Users,
I am now thee happiest boy on Earth.

- Chris.

### I know it should be ".. the happiest .. "; but that pales.

#9

My D7 instance is hosted on a commercial site. I don't have access to the filesystem above $HOME. To be clear, I can't put stuff in /tmp.
I found that setting my Home » Administration » Configuration » Media Temporary directory to "tmp" without the slash AND setting that directory's permissions to 0777 allowed me to install modules from their URL.

That's all I needed to do

#10

I met the same problem, tried different route, such as changing "/tmp" to "/tmp2 or /tmp3", etc. None worked!

Finally, it was the post by pete_I on May 3, 2011 saved my life. Thanks a lot!

#11

All you really need to do if you are having problems is to remove the forward-slash ("/") from "/tmp"
and specify

tmp

only at --> [Your-D7-root-home] » Administration » Configuration » Media: File system » Temporary directory.

My conclusion is that 'when' these errors and problems occur
they are always on Drupal 7 online manual installations at commercial webhosts
and are a result of the forward slash ( "/") being the first character in the default
[Your-D7-root-home] » Administration » Configuration » Media: File system » Temporary directory
field-box. ... the default text in that field-box being /tmp.

(Strangely; the problem was limited to only one of my
two identical-type-of-accounts at the same webhost;
and the problem mysteriously went away one day.)

My understanding is that using the forward-slash as the first character
in that field-box was causing D7 to try to use a folder (directory) two levels higher
than my public_html folder (directory) at my commercial webhost
and that that was the source of the conflict.

This was only a problem with manual installs of D7 and was Not a problem
when I installed D7 using my webhost's free CPanel SimpleScripts tool
that automates the entire D7 installation. (Most Webhosts provide this free service)

All you really need to do if you are having problems is to remove the forward-slash ("/")
and specify tmp only; and when you click the button
"Save configuration", Drupal 7 will create a folder at [Your-D7-root-home]/tmp
and will use that location without any further problems;
and you should Not need to adjust any permission levels (0777, etc.)
on that folder: Per my understanding and experience.

I was wrong earlier to think that files would accumulate in that folder
(which is why I had been recommending originally that
you try different names starting with the "/");
where-as all I see in that temporary folder
is an occasional empty folder or two.

-cjfr

All the best.

#12

Thank you so much for this post.

Perfect solution.

#13

Thanks! That stopped me going round and round:-)
Much appreciated.

#14

I got this error when i wanted to update Drupal database(after downloading new versions of some modules):

"...could not be saved to temporary://update-cache-1afc1ece..."

Going to Administration » Configuration » Media: File system and clicking "Save configuration" button solved my problem(without any changes).

#15

Yours and other posts here are helpful. Thanks. However D7 recommends that the tmp directory is not public.

I've done a manual install of D7, so by removing the leading slash, my tmp directory would reside in the same location as core files and the sites directory [public_html]. Does this really pose a risk, and why?

Garry

#16

I'm having these errors on Drupal 7.12 after enabling and then disabling the css/js aggregation. I tried removing the forward slash so it was tmp but it didn't help. Not sure what to do more.

EDIT:
error finally went away when I did chmod 777 sites/default/files -R. I had chmoded all the folders I suspected before this.

#17

I thought I should follow the requirement

This directory should not be accessible over the web.

Merely clicking save as in #14 did not work for me. I set the value to /tmp/drupaltmp and it worked fine.
btw this has only happened to me on 2 of 14 D7 installs and both were using hosts quickinstall script, never happened on a manual install.