Upon accessing Special:SpecialPages, it thows: Fatal error: Cannot redeclare class SpecialMultiUpload in /home/www/lib/mediawiki-1.25.1/extensions/MultiUpload/SpecialMultiUpload.php on line 120
Topic on Extension talk:MultiUpload
Hi.
I've fixed this errors with this patch, preventing the class to be loaded again:
diff -r MultiUpload/SpecialMultiUpload.php MultiUpload.orig/SpecialMultiUpload.php
42,47d41
< /* IGGL */
< /* Try to fix
< * PHP Fatal error: Cannot redeclare class SpecialMultiUpload in /usr/local/mediawiki-extensions/MultiUpload/SpecialMultiUpload.php on line 0, referer: https://wiki03.terma.com/sandbox/index.php/Special:Upload
< */
< if(!class_exists('SpecialMultiUpload')){
<
127,135d120
< /* IGGL */
< }
<
< /* IGGL */
< /* Try to fix
< * PHP Fatal error: Cannot redeclare class MultiUploadForm in /usr/local/mediawiki-extensions/MultiUpload/SpecialMultiUpload.php on line 0, referer: https://wiki03.terma.com/sandbox/index.php/Special:Upload
< */
< if(!class_exists('MultiUploadForm')){
<
208,209d192
< /* IGGL */
< }
233,237d215
<
< /* Try to fix
< * PHP Fatal error: Cannot redeclare class DerivativeRequest in /usr/local/mediawiki-extensions/MultiUpload/SpecialMultiUpload.php on line 0, referer: https://wiki03.terma.com/sandbox/index.php/Special:Upload
< */
< if ( !class_exists( 'DerivativeRequestWithFiles' ) ) {
254,255d231
< /* IGGL */
< }
260,263d235
< /* Try to fix
< * PHP Fatal error: Cannot redeclare class DerivativeRequest in /usr/local/mediawiki-extensions/MultiUpload/SpecialMultiUpload.php on line 0, referer: https://wiki03.terma.com/sandbox/index.php/Special:Upload
< */
< if ( !class_exists( 'DerivativeRequestWithFiles' ) ) {
265,266d236
< /* IGGL */
< }
269,274d238
< /* IGGL */
< /* Try to fix
< * PHP Fatal error: Cannot redeclare class UploadRow in /usr/local/mediawiki-extensions/MultiUpload/SpecialMultiUpload.php on line 0, referer: https://wiki03.terma.com/sandbox/index.php/Special:Upload
< */
< if(!class_exists('UploadRow')){
<
497,504d460
< /* IGGL */
< }
<
< /* IGGL */
< /* Try to fix
< * PHP Fatal error: Cannot redeclare class UploadFormRow in /usr/local/mediawiki-extensions/MultiUpload/SpecialMultiUpload.php on line 0, referer: https://wiki03.terma.com/sandbox/index.php/Special:Upload
< */
< if(!class_exists('UploadFormRow')){
634,636d589
< /* IGGL */
< }
<
This seems to fix the form display, but sadly still do not works.
When trying to upload files, I always get the error:
The file you uploaded seems to be empty. This might be due to a typo in the filename. Please check whether you really want to upload this file.
I'm not able to find the problem. The debug information:
Start request POST /sandbox/index.php/Special:MultiUpload HTTP HEADERS: HOST: <HOSTNAME> USER-AGENT: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.6.0 ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ACCEPT-LANGUAGE: en-US,en;q=0.5 ACCEPT-ENCODING: gzip, deflate REFERER: https://<HOSTNAME>/sandbox/index.php/Special:MultiUpload COOKIE: wikisandboxdbUserID=3; wikisandboxdbUserName=Iggl; wikisandboxdb_session=<SESSION>; uls-previous-languages=%5B%22en%22%5D CONNECTION: keep-alive CONTENT-TYPE: multipart/form-data; boundary=---------------------------38489103911317133881752535727 CONTENT-LENGTH: 22936 [caches] main: EmptyBagOStuff, message: SqlBagOStuff, parser: SqlBagOStuff Connected to database 0 at localhost Connected to database 0 at localhost [caches] LocalisationCache: using store LCStoreDB Fully initialised User: cache miss for user 3 User: loading options for user 3 from database. User: logged in from session User: loading options for user 3 from override cache. [MessageCache] MessageCache::load: Loading en... got from global cache Unstubbing $wgParser on call of $wgParser::firstCallInit from MessageCache::getParser Parser: using preprocessor: Preprocessor_DOM Unstubbing $wgLang on call of $wgLang::_unstub from ParserOptions::__construct User::getBlockedStatus: checking... UploadBase::createFromRequest: class name: UploadFromFile UploadBase::createFromRequest: class name: UploadFromFile [GlobalTitleFail] MessageCache::parse called by FileIndexer::addCheckboxToUploadForm/Message::__toString/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by MultiUploadForm::__construct/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [Preprocessor] Saved preprocessor XML to memcached (key wikisandboxdb:preprocess-xml:<HASH>:0) [Preprocessor] Saved preprocessor XML to memcached (key wikisandboxdb:preprocess-xml:<HASH>:0) [GlobalTitleFail] MessageCache::parse called by MultiUploadForm::getLegend/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by MultiUploadForm::getLegend/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by MultiUploadForm::getLegend/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. DatabaseBase::query: Writes done: REPLACE INTO `objectcache` (keyname,value,exptime) VALUES ('X') OutputPage::sendCacheControl: private caching; ** LoadBalancer::reuseConnection: this connection was not opened as a foreign connection [runJobs] Running 1 job(s) via '/sandbox/index.php?title=Special%3ARunJobs&tasks=jobs&maxjobs=1&sigexpiry=1435317559&signature=<SIGNATURE>' [runJobs] Failed to start cron API: received 'HTTP/1.1 403 Forbidden ' Request ended normally
Same information using builtin upload form:
Start request POST /sandbox/index.php/Special:Upload HTTP HEADERS: HOST: <HOSTNAME> USER-AGENT: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.6.0 ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ACCEPT-LANGUAGE: en-US,en;q=0.5 ACCEPT-ENCODING: gzip, deflate REFERER: https://<HOSTNAME>/sandbox/index.php/Special:Upload COOKIE: wikisandboxdbUserID=3; wikisandboxdbUserName=Iggl; wikisandboxdb_session=<SESSION>; uls-previous-languages=%5B%22en%22%5D CONNECTION: keep-alive CONTENT-TYPE: multipart/form-data; boundary=---------------------------1832873965988468950239988269 CONTENT-LENGTH: 175165 [caches] main: EmptyBagOStuff, message: SqlBagOStuff, parser: SqlBagOStuff Connected to database 0 at localhost Connected to database 0 at localhost [caches] LocalisationCache: using store LCStoreDB Fully initialised User: cache miss for user 3 User: loading options for user 3 from database. User: logged in from session User: loading options for user 3 from override cache. [MessageCache] MessageCache::load: Loading en... got from global cache Unstubbing $wgParser on call of $wgParser::firstCallInit from MessageCache::getParser Parser: using preprocessor: Preprocessor_DOM Unstubbing $wgLang on call of $wgLang::_unstub from ParserOptions::__construct User::getBlockedStatus: checking... UploadBase::createFromRequest: class name: UploadFromFile WebRequestUpload::getName: <FILE>.png normalized to '<FILE>.png' WebRequestUpload::getName: <FILE>.png normalized to '<FILE>.png' WebRequestUpload::getName: <FILE>.png normalized to '<FILE>.png' FSFile::getProps: Getting file info for /tmp/phpQWmUQm MimeMagic::__construct: loading mime types from <MWPATH>/sandbox/includes/mime.types MimeMagic::__construct: loading mime info from <MWPATH>/sandbox/includes/mime.info MimeMagic::doGuessMimeType: analyzing head and tail of /tmp/phpQWmUQm for magic numbers. MimeMagic::doGuessMimeType: getimagesize detected /tmp/phpQWmUQm as image/png MimeMagic::guessMimeType: guessed mime type of /tmp/phpQWmUQm: image/png MimeMagic::improveTypeFromExtension: improved mime type for .png: image/png [XMP] XMPReader::doAttribs Ignoring unrecognized element <http://ns.adobe.com/xap/1.0/mm/:InstanceID>. [XMP] XMPReader::doAttribs Ignoring unrecognized element <http://ns.adobe.com/xap/1.0/mm/:DocumentID>. [XMP] XMPReader::startElementModeInitial Ignoring unrecognized element <http://ns.adobe.com/xap/1.0/mm/:DerivedFrom>. FSFile::getProps: /tmp/phpQWmUQm loaded, 173826 bytes, image/png. mime: <image/png> extension: <png> UploadBase::detectScript: checking for embedded scripts and HTML stuff UploadBase::detectScript: no scripts found ZipDirectoryReader: Fatal error: zip file lacks EOCDR signature. It probably isn't a zip file. UploadBase::detectVirus: virus scanner disabled FSFile::getProps: Getting file info for /tmp/phpQWmUQm MimeMagic::doGuessMimeType: analyzing head and tail of /tmp/phpQWmUQm for magic numbers. MimeMagic::doGuessMimeType: getimagesize detected /tmp/phpQWmUQm as image/png MimeMagic::guessMimeType: guessed mime type of /tmp/phpQWmUQm: image/png MimeMagic::improveTypeFromExtension: improved mime type for .png: image/png [XMP] XMPReader::doAttribs Ignoring unrecognized element <http://ns.adobe.com/xap/1.0/mm/:InstanceID>. [XMP] XMPReader::doAttribs Ignoring unrecognized element <http://ns.adobe.com/xap/1.0/mm/:DocumentID>. [XMP] XMPReader::startElementModeInitial Ignoring unrecognized element <http://ns.adobe.com/xap/1.0/mm/:DerivedFrom>. FSFile::getProps: /tmp/phpQWmUQm loaded, 173826 bytes, image/png. UploadBase::verifyExtension: mime type image/png matches extension png, passing file UploadBase::verifyFile: all clear; passing. FileBackendStore::getFileStat: File mwstore://local-backend/local-public/f/fc/<FILE>.png does not exist. FileBackendStore::getFileStat: File mwstore://local-backend/local-public/archive/f/fc/20150626111255!<FILE>.png does not exist. DatabaseBase::query: Writes done: INSERT IGNORE INTO `image` (img_name,img_size,img_width,img_height,img_bits,img_media_type,img_major_mime,img_minor_mime,img_timestamp,img_description,img_user,img_user_text,img_metadata,img_sha1) VALUES ('X') [ContentHandler] Created handler for wikitext: WikitextContentHandler [StashEdit] No cache value for key 'wikisandboxdb:prepared-edit:<HASH>'. [GlobalTitleFail] MessageCache::parse called by FileIndexer::articleSave/Message::__toString/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by FileIndexer::articleSave/Message::__toString/Message::toString/Message::parseText/MessageCache::parse with no title set. WikiPage::doEditUpdates: No vary-revision, using prepared edit... Saved in parser cache with key wikisandboxdb:pcache:idhash:43-0!*!*!*!*!*!* and timestamp 20150626111255 and revision id 69 DatabaseBase::query: Writes done: REPLACE INTO `objectcache` (keyname,value,exptime) VALUES ('X') BacklinkCache::queryLinks: got results from DB BacklinkCache::queryLinks: got results from DB BacklinkCache::queryLinks: got results from DB LoadBalancer::reuseConnection: this connection was not opened as a foreign connection Title::getRestrictionTypes: applicable restrictions to [[File:<FILE>.png]] are {edit,move,upload} LoadBalancer::reuseConnection: this connection was not opened as a foreign connection LoadBalancer::reuseConnection: this connection was not opened as a foreign connection Job with hash '<HASH>' is a duplicate. BacklinkCache::partition: got from full result cache LoadBalancer::reuseConnection: this connection was not opened as a foreign connection IP: <HOSTIP> BacklinkCache::partition: got from full result cache OutputPage::sendCacheControl: private caching; ** LoadBalancer::reuseConnection: this connection was not opened as a foreign connection [runJobs] Running 1 job(s) via '/sandbox/index.php?title=Special%3ARunJobs&tasks=jobs&maxjobs=1&sigexpiry=1435317180&signature=<SIGNATURE>' [runJobs] Failed to start cron API: received 'HTTP/1.1 403 Forbidden ' Request ended normally
Same error I have here,
MediaWiki version 1.25,
MultiUpload version 1.25 MultiUpload: REL1_25 2015-06-16T21:13:04
db0c9d4
The solution seems more simple:
Comment out this line in MultiUpload.php by adding a #
character in front of it:
$wgAutoloadClasses['FauxWebRequestUpload'] = __DIR__ . '/SpecialMultiUpload.php';
Once done, it works for me.
That got me past the error also. Now have to fix forever spinning gif.
For me, the error was, when accessing http://<mymediawikiinstallation>:Especial:PáginasEspeciales
Fatal error: Cannot redeclare class SpecialMultiUpload in /var/www/mediawiki-1.25.2/extensions/MultiUpload/SpecialMultiUpload.php on line 0
The solution I found from @Ciencia Al Poder's:
sudo sed -i "s/\(\$wgSpecialPages\['MultiUpload'\] = 'SpecialMultiUpload';\)/# \1/" /var/www/mediawiki-1.25.2/extensions/MultiUpload/MultiUpload.php