Hi, I installed mediawiki for local use only, just to try the software and learn how to use. I uploaded two files and created a new page that uses these files. All was ok. But when I did this API query on my browser:


http://localhost/wiki-1/api.php?format=xml&action=query&titles=File:Hyph.png&prop=imageinfo&iiprop=url


I get this page with error message:


############ start of error message ############

<api><error code="internal_api_error_MWException" info="Exception Caught: Internal error in ApiResult::setElement: Bad parameter" xml:space="preserve">

#0 /opt/wiki-1/core/includes/api/ApiBase.php(1408): wfDebugDieBacktrace('Internal error ...') #1 /opt/wiki-1/core/includes/api/ApiResult.php(144): ApiBase::dieDebug('ApiResult::setE...', 'Bad parameter') #2 /opt/wiki-1/core/includes/api/ApiResult.php(290): ApiResult::setElement('page', 'imagerepository', '', false) #3 /opt/wiki-1/core/includes/api/ApiQueryImageInfo.php(174): ApiResult->addValue(Array, 'imagerepository', '') #4 /opt/wiki-1/core/includes/api/ApiQuery.php(276): ApiQueryImageInfo->execute()
#5 /opt/wiki-1/core/includes/api/ApiMain.php(797): ApiQuery->execute()
#6 /opt/wiki-1/core/includes/api/ApiMain.php(368): ApiMain->executeAction()
#7 /opt/wiki-1/core/includes/api/ApiMain.php(346): ApiMain->executeActionWithErrorHandling()
#8 /opt/wiki-1/core/api.php(76): ApiMain->execute()
#9 {main}

</error></api>

############ end of error message ############


It seems the error happends when it is traing to create the 'imagerepository' element of the result page.

The DebugLogFile said:


############ start of DebugLogFile ############

Start request GET /wiki-1/api.php?format=xml&action=query&titles=File:Hyph.png&prop=imageinfo&iiprop=url
HTTP HEADERS:
HOST: localhost
USER-AGENT: Mozilla/5.0 (X11; Linux i686; rv:10.0.3) Gecko/20100101 Firefox/10.0.3 Iceweasel/10.0.3
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
ACCEPT-LANGUAGE: it,fr;q=0.8,es;q=0.6,en;q=0.4,de;q=0.2
ACCEPT-ENCODING: gzip, deflate
CONNECTION: keep-alive
COOKIE: wikiUserName=Massimo; wikiEditor-0-booklet-characters-page=ipa; wikiEditor-0-booklet-help-page=file; wikiUserID=1; wikiToken=e85b7cfa3082e442cf10fd38976a81a8; wiki_session=16o6j94lju6518a51h9mp6h1l4; mw_installer_session=1ab90be1j9j5d60npu0qlcs655; wiki-1_wiki-1_session=0bjql89ebjlc70i4kta24an6m7; wiki-1_wiki-1UserID=1; wiki-1_wiki-1UserName=Massimo; wikiEditor-0-toolbar-section=advanced
CACHE-CONTROL: max-age=0
CACHES: EmptyBagOStuff[main] SqlBagOStuff[message] SqlBagOStuff[parser]
session_set_cookie_params: "0", "/", "", "", "1"
Class LanguageIt not found; skipped loading
LocalisationCache: using store LCStore_DB
Connecting to localhost wiki-1...
Profiler::instance called without $wgProfiler['class'] set, falling back to ProfilerStub for safety
Connected to localhost wiki-1.
Fully initialised
Connecting to localhost wiki-1...
Connected to localhost wiki-1.
MessageCache::load: Loading it... got from global cache
Gadget::loadStructuredList: MediaWiki:Gadgets-definition parsed, cache entry wiki-1-wiki-1:gadgets-definition:6 updated
LoadBalancer::getConnection: using server localhost for group api
[48c573c4] /wiki-1/api.php?format=xml&action=query&titles=File:Hyph.png&prop=imageinfo&iiprop=url Exception from line 1759 of /opt/wiki-1/core/includes/GlobalFunctions.php: Internal error in ApiResult::setElement: Bad parameter
ApiMain::setCacheMode: setting cache mode private

############ end of DebugLogFile ############


It happens the same for the other files. I tried looking for help on Internet but without succes. I don't understand: the files exist in my "images" directory and the page I created shows them. I thought maybe I must explicitly create the local repository object of images and therefore I tried to put this code in my LocalSettings.php:


  $wgLocalFileRepo[] = array(
    'class'             => 'LocalRepo',
    'name'              => 'local'
  );


but in this case I get a full white page.
Here are versions of my software:


  O.S.:      Debian GNU/Linux testing
  apache:    2.2.22
  php:       5.4.4
  mysql:     5.5.24
  mediawiki: from git (1.20alpha) but I tried also with 1.19.1


At the end of this e-mail I put my LocalSettings.php.
Thanks for any help and excuse me for my bad english.
Massimo


############ start of LocalSettings.php ############

<?php
# This file was automatically generated by the MediaWiki 1.20alpha
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
# http://www.mediawiki.org/wiki/Manual:Configuration_settings

# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
        exit;
}

## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

$wgSitename      = "miowiki";
$wgMetaNamespace = "Miowiki";

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath       = "/wiki-1";
$wgScriptExtension  = ".php";

## The protocol and server name to use in fully-qualified URLs
$wgServer           = "http://localhost";;

## The relative URL path to the skins directory
$wgStylePath        = "$wgScriptPath/skins";

## The relative URL path to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo             = "$wgStylePath/common/images/wiki-1.png";

## UPO means: this is also a user preference option

$wgEnableEmail      = true;
$wgEnableUserEmail  = true; # UPO

$wgEmergencyContact = "massimo@localhost";
$wgPasswordSender   = "massimo@localhost";

$wgEnotifUserTalk      = false; # UPO
$wgEnotifWatchlist     = false; # UPO
$wgEmailAuthentication = true;

## Database settings
$wgDBtype           = "mysql";
$wgDBserver         = "localhost";
$wgDBname           = "wiki-1";
$wgDBuser           = "xxx";
$wgDBpassword       = "xxx";

# MySQL specific settings
$wgDBprefix         = "wiki-1";

# MySQL table options to use during installation or update
$wgDBTableOptions   = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

# Experimental charset support for MySQL 5.0.
$wgDBmysql5 = false;

## Shared memory settings
$wgMainCacheType    = CACHE_NONE;
$wgMemCachedServers = array();

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads  = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

# InstantCommons allows wiki to use images from http://commons.wikimedia.org
$wgUseInstantCommons  = false;

## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "it_IT.utf8";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
$wgHashedUploadDirectory = false;

## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publically accessible from the web.
#$wgCacheDirectory = "$IP/cache";

# Site language code, should be one of the list in ./languages/Names.php
$wgLanguageCode = "it";

$wgSecretKey = "xxx";

# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = "xxx";

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
$wgDefaultSkin = "vector";

## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl  = "http://creativecommons.org/licenses/by-sa/3.0/";;
$wgRightsText = "Creative Commons Attribuzione-Condividi allo stesso modo";
$wgRightsIcon = "{$wgStylePath}/common/images/cc-by-sa.png";

# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";

# Query string length limit for ResourceLoader. You should only set this if
# your web server has a query string length limit (then set it to that limit),
# or if you have suhosin.get.max_value_length set in php.ini (then set it to
# that value)
$wgResourceLoaderMaxQueryLength = -1;


# Enabled Extensions. Most extensions are enabled by including the base extension file here
# but check specific extension documentation for more details
# The following extensions were automatically enabled:
require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" );
require_once( "$IP/extensions/Gadgets/Gadgets.php" );
require_once( "$IP/extensions/ImageMap/ImageMap.php" );
require_once( "$IP/extensions/InputBox/InputBox.php" );
require_once( "$IP/extensions/Interwiki/Interwiki.php" );
require_once( "$IP/extensions/Nuke/Nuke.php" );
require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );
require_once( "$IP/extensions/Renameuser/Renameuser.php" );
require_once( "$IP/extensions/Vector/Vector.php" );
require_once( "$IP/extensions/WikiEditor/WikiEditor.php" );


# End of automatically generated settings.
# Add more configuration options below.

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'JPG', 'jpeg', 'svg',

$wgDebugLogFile = '/tmp/wiki_errors';
$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;
$wgDevelopmentWarnings = true;'ogg' );

############ end of LocalSettings.php ############

_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to