Mediawiki 1.19 Unable to save thumbnail to destination
17 September 2012, 17:09:43In English:
If you have error
Error creating thumbnail: Unable to save thumbnail to destination
you can solve it with
1) Put code in your LocalSettings.php:
$wgTmpDirectory = "$IP/images/temp"; |
(apache must be able to write in this folder)
2) OR Put another code in your LocalSettings.php:
putenv('TMPDIR=/path/to/my/temp/folder'); |
(apache must be able to write in this folder)
3) Or, if you are running a really strict server with safemode and so on - edit file includes/GlobalFunctions.php and replace piece
2493 2494 2495 | if( function_exists( 'sys_get_temp_dir' ) ) { return sys_get_temp_dir(); } |
with
return ini_get('upload_tmp_dir'); |
One of those solutions will work for sure :)
I had to make 1) and 3) to return my thumbnails…
По русски:
При ошибке
Ошибка создания миниатюры: Не удаётся сохранить эскиз по месту назначения
Мы можем сделать следующее:
1) Добавьте код в LocalSettings.php:
$wgTmpDirectory = "$IP/images/temp"; |
(у сервера должны быть права записи в указанную папку)
2)Или добавьте другой код в LocalSettings.php:
putenv('TMPDIR=/path/to/my/temp/folder'); |
(у сервера должны быть права записи в указанную папку)
3) Или, если мы на суровом сервере в сейф моде - берём файл includes/GlobalFunctions.php и заменяем
2493 2494 2495 | if( function_exists( 'sys_get_temp_dir' ) ) { return sys_get_temp_dir(); } |
на
return ini_get('upload_tmp_dir'); |
Что-нибудь из этого поможет наверняка. Мне помогла совокупность 1) и 3)

Subscribe? Sure? What for?

not working for me :-(
tested 1 & 2 & 3, with correct paths
(listed in my open_basedir/safe_mode),
with mediawiki 1.19.2:
PHP Warning: putenv(): Safe Mode warning: Cannot set environment variable ‘TMPDIR’ – it’s not in the allowed list
safe_mode_exec_dir is also set
to a dir with graphicsmagick binaries
(it was working with 1.18.x)
note: my provider has this limitation:
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
tried aslo allowing TMPDIR in php.ini:
safe_mode_allowed_env_vars = PHP_,TMPDIR
http://www.php.net/manual/en/ini.sect.safe-mode.php#ini.safe-mode-allowed-env-vars
then restarted apache.
result: thumbnails still not working
Hello! Try the first and the third option listed in my post – those should help in safe mode.
Hello, I’ve tried to apply the first and third option of our post:
* i’ve set $wgTmpDirectory to a writable path under my open_basedir, in my LocalSettings.php
* this is my change in GlobalFunctions.php (deleted lines reported starting with minus, added lines reported starting with plus):
- if( function_exists( ‘sys_get_temp_dir’ ) ) {
- return sys_get_temp_dir();
- }
+ return ini_get(‘upload_tmp_dir’);
Although, with safe_mode active I can’t get thumbnails to be generated before or after upload. :-(
Anyway, thank you!
Спасибо! Помогло лишь правкой LocalSettings.php
Solution 1) didn’t fix it for me. Combining 1) and 2) did – thanks :)
My solution for MediaWiki 1.20.3 has been to add the following line to LocalSettings.php
$wgTmpDirectory = ini_get(‘upload_tmp_dir’);
Thank you so much for this fix. Mediawiki has useless support and I would probably never have been able to fix this without your help.
Small update for my version was to change 3) for:
remove:
return sys_get_temp_dir();
replace with:
return ini_get(‘upload_tmp_dir’);
Thanks =)
НЕ сработал не один из вариантов версия 1.20.4
так как в моей версии в файле includes/GlobalFunctions.php
Функция отсутвует
if( function_exists( ‘sys_get_temp_dir’ ) ) {
return sys_get_temp_dir();
сделал так как написал Andy
return sys_get_temp_dir();
заменил на :
return ini_get(‘upload_tmp_dir’);
но не помогло и это