Project:Support desk/Sections/Uploading

__NEWSECTIONLINK__

= Uploading Support =

.TMP File issue?

Mediawiki Version: latest, PHP version Latest mySQL latest --- When Users try to upload images onto the wiki, they get a error that states "Cannot find C:\WINDOWS\TEMP\PHP"X" Whereas X indicates a letter (currently PHPc.tmp) I've disabled Imagemagic(sp?) and I am still getting an error. Can I remote host the images and what tag would I use to embed it?

Potential bug in FSRepo.php causes image uploads to fail on Windows server: Internal error - Could not create directory

 * MediaWiki version: 1.15.0
 * PHP version: 5.1.6 (apache2handler)
 * MySQL version: 5.0.45-community-nt
 * URL: index.php?title=Special:Upload (on a private wiki)

I've been trying to debug file uploads on my Windows server. After going to Special:Upload and uploading a jpg (an allowed format) it would die with something like this: Internal error

Could not create directory "public/a/a5".

It would also generate a PHP error: Warning: mkdir [function.mkdir]: No such file or directory in \includes\GlobalFunctions.php on line 2012

I did some debugging and mkdir is called by wfMkdirParents which in this case is called by publishBatch in FSRepo.php line 298: if ( !is_dir( $dstDir ) && !wfMkdirParents( $dstDir ) ) {

I think the $dstDir path is not a valid one on the Windows server because the path is constructed manually in publishBatch using forward slashes ("/"), so what gets eventually passed to mkdir is something that looks like this: C:\my\path\htdocs\mediawiki/images/a/a5

I added this statement to GlobalFunctions.php at line 2011 to fix the path: $dir = str_replace('/', '\\', $dir);

So $dir was changed to something like this: C:\my\path\htdocs\mediawiki\images\a\a5

This solved my problem and I was able to upload files. Perhaps FSRepo.php needs to be more sensitive to servers that require a backslash as a path separator? Or is there a better way to fix this problem?

I am not running PHP in safe_mode and I have left $wgHashedUploadDirectory defaulted to true.

cheers, Dave

--Dmarwick 05:42, 1 July 2009 (UTC)

Change File Upload Destination to different partition on server

 * MediaWiki version: 1.14.0
 * PHP version: 5.2.9-1
 * MySQL version: 5.1.32
 * URL: private

I have a server that I set up MediaWiki on. Unfortunately it was installed in the C: partition that doesn't have much extra space. So, I'd like to point the file upload path to another partition (D:) on the server. I would appreciate any help you can provide. Thank you.

Arsajm 17:27, 9 July 2009 (UTC)

Special:Import error
I fixed this error by setting $wgDBmysql5 = false;


 * MediaWiki version: 1.15.0
 * PHP version: 5.1.6 (apache2handler
 * MySQL version: 5.0.45
 * URL: http://school.rm-f.me/wiki/index.php/Main_Page

I am trying to import the help pages from mediawiki as per the instructions found on http://www.mediawiki.org/wiki/Project:PD_help/Copying

I keep getting the following error and can not find any info on it.'''I found a fix. See above.'''

Error in fetchObject: Illegal mix of collations (latin1_bin,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' (localhost)

Backtrace:


 * 1) 0 /var/www/html/school/wiki/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php(1608): Database->fetchObject(false)
 * 2) 1 /var/www/html/school/wiki/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php(1577): SMWSQLStore2->getSMWPageIDandSort('???????????????...', 0, , , true)
 * 3) 2 /var/www/html/school/wiki/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php(647): SMWSQLStore2->getSMWPageID('???????????????...', 0, '')
 * 4) 3 /var/www/html/school/wiki/extensions/SemanticForms/includes/SF_LinkUtils.inc(224): SMWSQLStore2->getInProperties(Object(SMWWikiPageValue))
 * 5) 4 /var/www/html/school/wiki/extensions/SemanticForms/includes/SF_LinkUtils.inc(209): SFLinkUtils::addDataLink(Object(Title))
 * 6) 5 [internal function]: SFLinkUtils::setBrokenLink(Object(SkinMonoBook), Object(Title), Array, '???????????????...', Array, NULL)
 * 7) 6 /var/www/html/school/wiki/includes/Hooks.php(117): call_user_func_array(Array, Array)
 * 8) 7 /var/www/html/school/wiki/includes/Linker.php(222): wfRunHooks('LinkEnd', Array)
 * 9) 8 /var/www/html/school/wiki/includes/Linker.php(509): Linker->link(Object(Title), '???????????????...', Array, Array, 'broken')
 * 10) 9 /var/www/html/school/wiki/includes/parser/LinkHolderArray.php(233): Linker->makeBrokenLinkObj(Object(Title), '???????????????...', '')
 * 11) 10 /var/www/html/school/wiki/includes/parser/LinkHolderArray.php(115): LinkHolderArray->replaceInternal('
 * MediaWiki version:
 * PHP version:
 * MySQL version:
 * URL:

The message on the download page shows that current MeidaWiki download has been unavailable for 3 days asfo 11-3 UTC tonight Is this page 'in error' or if its true can you give an idea of when this will available again? The archive seems to not offer anything above V 1.10 Thanks

—82.21.211.115 16:40, 19 July 2009 (UTC)


 * This seems to be back up again; I've removed the message. Let us know if you have any problems downloading. Happy ‑ melon 16:46, 19 July 2009 (UTC)

(RESOLVED) Unable to create public/x/x errors...

 * MediaWiki version: 1.15.1
 * PHP version: 5.2.10
 * MySQL version: 5.0.81
 * URL: http://www.aesedra.com/wiki/

I recently upgraded to wiki 1.15.1 and it went well. The thing is, when I try to upload a picture, I get ''Could not create directory "public/3/3b". . In my logs, I get Wed Jul 22 01:21:25 2009] [error] PHP Warning: mkdir [function.mkdir]: Permission denied in /home/aesedra/public_html/wiki/includes/GlobalFunctions.php on line 2012''

The images directory has been set to 777, LocalSettings.php has $wgEnableUploads = true; ''$wgUploadPath = "$wgScriptPath/images"; $wgUploadDirectory = "$IP/images"; ''

mkdir is not a disallowed function on my site. It works.

The funny thing is, if I go to any page that has a picture, I get a php warning (but the picture still shows) [Wed Jul 22 01:17:49 2009] [error] PHP Warning: imagejpeg [function.imagejpeg]: Unable to open '/home/aesedra/public_html/wiki/images/thumb/4/41/Wikibelantine.jpg/85px-Wikibelantine.jpg' for writing: Permission denied in /home/aesedra/public_html/wiki/includes/media/Bitmap.php on line 236

I'm not sure what's going on here, and thanks in advance for your help.

Edit: the uploads now work, but now I'm getting a zillion PHP warnings and black thumbnails.

—Peter Greenwell 06:26, 22 July 2009 (UTC)


 * Same problem here:


 * MediaWiki version: 1.15.1
 * PHP: 5.2.4-2ubuntu5.6 (apache2handler)
 * MySQL: 5.0.51a-3ubuntu5.4


 * Is this a software bug or how can I fix it?
 * --JuergenL 12:43, 22 July 2009 (UTC)


 * OK, it seems there is a disconnect between what actually is in /images/ and what the database thinks there is. I had to delete all my pictures and re-upload them. That fixed the black thumbnails/permission denied errors. Thi all occurred because I upgraded to 1.15.1 from 1.14 something. The upgrade script bombed out saying no connection to the database could be found despite the settings being right. So, I had to reinstall the Wiki using the upgrade/reinstall guide found here. This is when everything started to go south. Somehow, the database wasn't upgraded correctly or something and what exists in my /images/ folder didn't correlate with what the db said. This is my guess. Anyhow, it's all fixed, but I'll be wary of upgrading anything from here on. Peter Greenwell 14:01, 22 July 2009 (UTC)


 * Same problem here:
 * MediaWiki version: 1.15.1
 * PHP: 5.2.6 (Debian Lenny)
 * MySQL: 5.0.51a (Debian Lenny)
 * We are shared upload and I managed to solve my problem by changing some parameters.
 * SOLVED: We were using "wgUseSharedUploads, wgSharedUploadPath..." and by moving to the new configuration parameters (wgForeignFileRepos) this solved this problem.
 * --Jlhenry 11:31, 24 July 2009 (UTC)

Change Upload Directory in MediaWiki 1.14

 * MediaWiki version: 1.14
 * PHP version: 5
 * MySQL version:
 * URL: NA

I have been creating a wiki on my localhost, it is a dell laptop,i have a dual boot, and have it on both the linux and windows sides, i have been creating it as a test for my company, i have found a variable in LocalSettings.php "$wgUploadDirectory" that can change the upload directory from the images directory in mediawiki, to another directory outside the mediawiki directory, namely a shared directory for the business, or as a test, MyDocuments directory in my C: drive. The documentation i've found is good, but not specific as to how you point it to a local directory outside of the mediawiki directory, i tried adding this line

$wgUploadDirectory = "C:\Documents and Settings\IDT user\My Documents"

and i got this error message: "Parse error: parse error in C:\xampp\htdocs\mediawiki\LocalSettings.php on line 133" which is the line i added. anyhelp you can as to what i need to add or what variable value i can put, to allow this to work would be appreciated.

—Abdullahva 14:02, 23 July 2009 (UTC)

Error 500 on IIS7 when uploading a newer file version

 * MediaWiki version: 1.15.1
 * PHP version: 5.2.9 (CGI)
 * MySQL version: 5.1.31
 * URL: intranet only

I successfully managed to install Mediawiki on an IIS7. Uploading works fine until one decides to upload a newer version of a file. Then the script dies with a 500 error. PHP logs and IIS logs DO NOT show any anomalities. When one uploads a newer version of a file, UNCHECKS the "ignore warnings" checkbox and accepts to overwrite everything works fine.

It would be helpful if there was an easy way to uncheck the "ignore warnings" checkbox by default. Thanks in advance for any help!

—213.227.166.95 12:49, 29 July 2009 (UTC)

Using Special:Import to import protected pages leaves pages still unprotected
We are trying to import custom made XML's with protected pages into the wiki. The pages are imported correctly but they are not protected.
 * MediaWiki version: 1.15.1
 * PHP version: 5.2.9 (apache2handler)
 * MySQL version: 5.1.36-community
 * URL: local

We use XML's like these:  Page title edit=sysop:move=sysop WikiSysop 1 Import protected page...

The mentioned XML Schema (http://www.mediawiki.org/xml/export-0.3.xsd) shows that the element "restrictions" is supported, but when used the pages is still not protected.

Please help...

—217.114.103.238 09:36, 30 July 2009 (UTC)