When I try import language file I get some errors like:
warning: rename(): SAFE MODE Restriction in effect. The script whose uid is 10165 is not allowed to access /tmp owned by uid 0 in ...
warning: fopen(): Unable to access /tmp/phpL14q3J.txt in ...
warning: fopen(/tmp/phpL14q3J.txt): failed to open stream: Success in ...
warning: Cannot modify header information - headers already sent by ...
I know that safe mode is enable on my hosting. Admins are helpfull set any parameters that I want but I don't know.
I think that safe mode off is not best solution.
Can anybody help me please.
THKS

Comments

Lupin3rd’s picture

I have the same problem, but it's strange, i don't have this problem with Drupal 4.6.3 in the my host.
I don't want disable safe mode in my server.
The new Drupal don't use the temp directory that i set in settings but /tmp. Why?

---
Visita drupal.it, la comunità italiana di Drupal.

PaulM’s picture

I delete directories that drupal default create (files,tmp). Then I create it myself via ftp (I use Total Commander).
In settings you must remove / before tmp (not /tmp just tmp).
Sorry for my bad english :-)
Last thing: I use Drupal version 4.6.3

Lupin3rd’s picture

With Drupal 4.6.3 works fine for me also... but i today upgrade to Drupal 4.6.5 and now i have this error.
My directories are created by ftp and have the same owner of drupal's files, in setting i have tmp (i also try with /var/ww/sites...., the full path but i have the same error)

---
Visita drupal.it, la comunità italiana di Drupal.

PaulM’s picture

Sorry, I can't help you. My solution was reinstall to older version of Drupal (4.6.3).

phacka’s picture

in includes/file.inc:
comment out lines 159-161

# rename($file->filepath, $file->filepath .'.txt');
# $file->filepath .= '.txt';
# $file->filename .= '.txt';

dopry’s picture

This is a common problem. you should create a tmp dir owned by the usethe script runs as then do use php_admin_value upload_tmp_dir to move the php tmp dir...

Alternatively I prefer to use open_basedir and upload_tmp_dir in place of safe mode on shared servers running mod_php... Less restrictive.

bilbord’s picture

Solution is very simple - open file includes/file.inc and find following lines:
// Operating system specific dirs.
if (substr(PHP_OS, 0, 3) == 'WIN') {
$directories[] = 'c:\\windows\\temp';
$directories[] = 'c:\\winnt\\temp';
$path_delimiter = '\\';
}
else {
$directories[] = '/tmp';
$path_delimiter = '/';
}

replace line $directories[] = '/tmp'; with something like $directories[] = '/capitalnonesens01';
name of the directory must not correspond to any existing directory - than directory files/tmp will be used instead of it. It is located in your drupal directory so no more problems with SAFE MODE ON.