I've installed Drupal a couple of days ago in a new database to test it out for a later site migration. Trying to import a new language file now, enabled the Localization & Upload modules but I get this error whenever I import the .po file:
* The language French has been created.
* File upload error. Could not move uploaded file.
* warning: tempnam() has been disabled for security reasons in /var/www/vhosts/medalgerie.com/httpdocs/testing/includes/file.inc on line 228.
* warning: move_uploaded_file() [function.move-uploaded-file]: Unable to access in /var/www/vhosts/medalgerie.com/httpdocs/testing/includes/file.inc on line 241.
* The translation import failed, because the file could not be read.
* The translation import of failed.
* 0/0 (0%) stings translated
I've done some research thru the forums, found that some people have had trouble with the "tempnam" function; the solutions provided didn't solve my problem. So, any help is greatly appreciated.
Comments
Re: Error when importing a new language
Set Drupal's temporary directory to "files/temp" from "admin/settings/file-system" . Also make sure that the "files/" directory is writable. Then retry importing the language.
Re:
Thanks mate; I'll try that out. :)
thanks
your way did great job wiht me!, thanks a lot!
Man, this is tiring me. I
Man, this is tiring me. I still get the same error message; could it be because my shared host has the PHP Safe Mode on?!
Re: Man, this is tiring me. I
Can you please provide the output of "ls -lR" on your "files/" directory?
Re:
I didn't quite understand what you mean by "Is - IR", progga. If you could elaborate a little; I appreciate yoru effort.
I think it's an error of the Upload Module; seems like this doesn't only occur when importing a translation but when trying to attach a file to a forum message as well.
Deactivating the Safe Mode of PHP didn't seem to change anything. I also tried renaming the temp folder inside /files, to no avail. This is the error message I still get:
* File upload error. Could not move uploaded file.
* warning: tempnam() has been disabled for security reasons in ../includes/file.inc on line 228.
* warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpr8LhGg' to '' in ../includes/file.inc on line 241.
Once more,
Can anyone suggest a way to go around this error?
Re: Once more
Looks like the root cause of the problem is tempnam(). The "disable_functions" directive in the php.ini might have been used to prevent its use. You can try running tempnam()'s example code from http://php.net/manual/ro/function.tempnam.php to findout whether it's really blocked. Or just execute this code from a php script:
echo ini_get('disable_function');
If tempnam() has been really banned, then it should be listed in the output.
Thanks alot. I'm going to
Thanks alot. I'm going to try it out as soon as I find me a host that supports drupal.
Importing language files...
Have you fixed your problem concerning the language files? I have the same kind of problem, and I don't use drupal 6.x for this reason... Somebody told me to modify my .htaccess files to fix it, but can't tell you wich parameters to use...
Danny
if fixed the problem by
if fixed the problem by creating my own tempnam() function in file.inc like this
alternative function
change function in file_save_data() function and change fopen to file_put_content
...
This worked for me! Thank's
This worked for me!
Thank's for your work.
Pol Maresma
PolNetwork.com