Project:Support desk

About this board

Welcome to the MediaWiki Support desk. This is a place where you can ask any questions you have about installing, using or administrating the MediaWiki software.

( Read this message in a different language )

See also

Before you post

Post a new question

  1. To help us answer your questions, please indicate which version of MediaWiki you are using, as found on your wiki's Special:Version page:
  2. If possible, add $wgShowExceptionDetails = true;error_reporting( -1 );ini_set( 'display_errors', 1 ); to LocalSettings.php in order to make MediaWiki show more detailed error messages.
  3. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  4. To start a new thread, click the box with the text " Start a new topic ".

svg transclusion in templates

2
Aloist ( talk contribs )

We have a template which places .gif images like this

https://www.astro.com/im/sym/s_su.18.gif

In the html page rendering, it appears as

<img src="https://www.astro.com/im/sym/s_su.18.gif" alt="s_su.18.gif">

I would like to replace the .gif image with a .svg image like this

https://www.astro.com/im/sym/s_su.18.svg

but that is rendered into

<a class="external free" href="https://www.astro.com/im/sym/s_su.18.svg">https://www.astro.com/im/sym/s_su.18.svg </a>


How can I have it rendered the same way as a gif image?

TheDJ ( talk contribs )

It's because core doesn't know svg as an image format for external images. It is not listed in EXT_IMAGE_REGEX of the Parser, only: gif,png,jpg,jpeg. This regex probably could use an update, please file a ticket in Phabricator to ask for this functionality.

(obligatory note about potential dangers of allowing your editors to include images from the internet)

Reply to "svg transclusion in templates"

Editing late husband's information

2
Titpup ( talk contribs )

I am the husband of the late Steve Hurley. I've attempted to make correction on his page but none of my corrections are saved. DOB 5/16/1957 DOD 4/16/2022 Place of Birth Ypsilanti, Michigan, USA.

P858snake ( talk contribs )

@ Titpup We have no such page on this wiki, as this wiki is about the MediaWiki software package, You would need to seek assistance on the wiki you are trying to edit.

Reply to "Editing late husband's information"

My MediaWiki shows error when first access.

3
318cyz ( talk contribs )

PHP Notice: Trying to access array offset on value of type null in C:\inetpub\wwwroot\mediawiki\includes\profiler\SectionProfiler.php on line 99

PHP Notice: Trying to access array offset on value of type null in C:\inetpub\wwwroot\mediawiki\includes\profiler\SectionProfiler.php on line 99

PHP Notice: Trying to access array offset on value of type null in C:\inetpub\wwwroot\mediawiki\includes\profiler\SectionProfiler.php on line 100

PHP Notice: Trying to access array offset on value of type null in C:\inetpub\wwwroot\mediawiki\includes\profiler\SectionProfiler.php on line 100

PHP Notice: Trying to access array offset on value of type null in C:\inetpub\wwwroot\mediawiki\includes\profiler\SectionProfiler.php on line 101

PHP Notice: Trying to access array offset on value of type null in C:\inetpub\wwwroot\mediawiki\includes\profiler\SectionProfiler.php on line 101


Refresh can load it correctly.

When I post changes the connection will reset, even on localhost.

Bawolff ( talk contribs )

Please include the contents of LocalSettings.php (minus any passwords or secret keys)

318cyz ( talk contribs )

<?php

# This file was automatically generated by the MediaWiki 1.41.1

# installer. If you make manual changes, please keep track in case you

# need to recreate them later.

#

# See includes/MainConfigSchema.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:

# https://www.mediawiki.org/wiki/Manual:Configuration_settings

# Protect against web entry

if ( !defined( 'MEDIAWIKI' ) ) {

? ?exit;

}

## Uncomment this to disable output compression

# $wgDisableOutputCompression = true;

$wgSitename = "TestProject";

## 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:

## https://www.mediawiki.org/wiki/Manual:Short_URL

$wgScriptPath = "/wiki";

$wgScriptExtension? = ".php";

$wgArticlePath = "${wgScriptPath}/$1";

## The protocol and server name to use in fully-qualified URLs

$wgServer = " http://www.vividcycle.org:32648 ";

## The URL path to static resources (images, scripts, etc.)

$wgResourceBasePath = $wgScriptPath;

## The URL paths to the logo.? Make sure you change this from the default,

## or else you'll overwrite your logo when you upgrade!

$wgLogos = [

? ?'1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",

? ?'icon' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",

];

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

$wgEnableEmail = true;

$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "318cyz@vividcycle.org";

$wgPasswordSender = "318cyz@vividcycle.org"; # The email is a false one

$wgEnotifUserTalk = true; # UPO

$wgEnotifWatchlist = true; # UPO

$wgEmailAuthentication = true;

## Database settings

$wgDBtype = "mysql";

$wgDBserver = "localhost";

$wgDBname = "my_wiki";

$wgDBuser = "wikiuser";

$wgDBpassword = [REDACTED];

# MySQL specific settings

$wgDBprefix = "";

$wgDBssl = false;

# MySQL table options to use during installation or update

$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

# Shared database table

# This has no effect unless $wgSharedDB is also set.

$wgSharedTables[] = "actor";

## Shared memory settings

$wgMainCacheType = CACHE_NONE;

$wgMemCachedServers = [];

## To enable image uploads, make sure the 'images' directory

## is writable, then set this to true:

$wgEnableUploads = false;

#$wgUseImageMagick = true;

#$wgImageMagickConvertCommand = "/usr/bin/convert";

# InstantCommons allows wiki to use images from https://commons.wikimedia.org

$wgUseInstantCommons = false;

# Periodically send a pingback to https://www.mediawiki.org/ with basic data

# about this MediaWiki instance. The Wikimedia Foundation shares this data

# with MediaWiki developers to help guide future development efforts.

$wgPingback = true;

# Site language code, should be one of the list in ./includes/languages/data/Names.php

$wgLanguageCode = "zh-cn";

# Time zone

$wgLocaltimezone = "UTC";

## Set $wgCacheDirectory to a writable directory on the web server

## to make your wiki go slightly faster. The directory should not

## be publicly accessible from the web.

#$wgCacheDirectory = "$IP/cache";

$wgSecretKey = [REDACTED];

# Changing this will log out all existing sessions.

$wgAuthenticationTokenVersion = "1";

# Site upgrade key. Must be set to a string (default provided) to turn on the

# web installer while LocalSettings.php is in place

$wgUpgradeKey = [REDACTED];

## 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 = "";

$wgRightsText = "";

$wgRightsIcon = "";

# Path to the GNU diff3 utility. Used for conflict resolution.

$wgDiff3 = "";

# The following permissions were set based on your choice in the installer

$wgGroupPermissions['*']['createaccount'] = false;

$wgGroupPermissions['*']['edit'] = false;

## Default skin: you can change the default skin. Use the internal symbolic

## names, e.g. 'vector' or 'monobook':

$wgDefaultSkin = "vector";

# Enabled skins.

# The following skins were automatically enabled:

wfLoadSkin( 'MinervaNeue' );

wfLoadSkin( 'MonoBook' );

wfLoadSkin( 'Timeless' );

wfLoadSkin( 'Vector' );

# Enabled extensions. Most of the extensions are enabled by adding

# wfLoadExtension( 'ExtensionName' );

# to LocalSettings.php. Check specific extension documentation for more details.

# The following extensions were automatically enabled:

wfLoadExtension( 'AbuseFilter' );

wfLoadExtension( 'CategoryTree' );

wfLoadExtension( 'Cite' );

wfLoadExtension( 'CiteThisPage' );

wfLoadExtension( 'CodeEditor' );

wfLoadExtension( 'ConfirmEdit' );

wfLoadExtension( 'DiscussionTools' );

wfLoadExtension( 'Echo' );

wfLoadExtension( 'Gadgets' );

wfLoadExtension( 'ImageMap' );

wfLoadExtension( 'InputBox' );

wfLoadExtension( 'Interwiki' );

wfLoadExtension( 'Linter' );

wfLoadExtension( 'LoginNotify' );

wfLoadExtension( 'Math' );

wfLoadExtension( 'MultimediaViewer' );

wfLoadExtension( 'Nuke' );

wfLoadExtension( 'OATHAuth' );

wfLoadExtension( 'PageImages' );

wfLoadExtension( 'ParserFunctions' );

wfLoadExtension( 'PdfHandler' );

wfLoadExtension( 'Poem' );

wfLoadExtension( 'ReplaceText' );

wfLoadExtension( 'Scribunto' );

wfLoadExtension( 'SecureLinkFixer' );

wfLoadExtension( 'SpamBlacklist' );

wfLoadExtension( 'SyntaxHighlight_GeSHi' );

wfLoadExtension( 'TemplateData' );

wfLoadExtension( 'TextExtracts' );

wfLoadExtension( 'Thanks' );

wfLoadExtension( 'TitleBlacklist' );

wfLoadExtension( 'VisualEditor' );

wfLoadExtension( 'WikiEditor' );

# End of automatically generated settings.

# Add more configuration options below.

Reply to "My MediaWiki shows error when first access."
2409:4063:4280:31CF:0:0:11DE:28AD ( talk contribs )
Reply to "Page Statistics"

Error 1264: Out of range value for column 'pp_page' at row 1

1
Kghbln ( talk contribs )
Reply to "Error 1264: Out of range value for column 'pp_page' at row 1"

[RESOLVED] Warning: is_executable(): open_basedir restriction in effect

11
Cavila ( talk contribs )

Since I've started a data refresh process that's necessary for Semantic MediaWiki, I'm seeing the following error message at the bottom of every page:

Warning: is_executable(): open_basedir restriction in effect. 
File(/usr/bin/php) is not within the allowed path(s): 
([...]/:/tmp/) in [...]/includes/Wiki.php on line 655 

Line 655 refers to something beginning

if ( !wfShellExecDisabled() && is_executable( $wgPhpCli ) )

No shell access as I'm on a shared host (with Suhosin enabled). Decreasing JobRunRate from "1" to e.g. "0.5" helps somewhat to reduce occurrences of the error message, but it does not solve the issue, let alone speed up the process.

With some googling you'll find a variety of solutions for PHP configuration issues involving "open_basedir restriction in effect", but almost none of them seems to cover this specific situation. The exception may be here , where the third suggestion about setting $wgPhpCli to a dummy value (?) might or might not be helpful in my case.

Any idea what could be done about it?

Cavila ( talk contribs )

Some additional notes. The problem persists even if the refresh process has been cancelled. I also noticed that a lot of wikis are affected by the same issue, although no bugzilla report has been submitted yet.

Cavila ( talk contribs )

OK, this may be a bug in MW 1.22:

  • $wgPhpCli used to have a default value of 'php', without any requirement to set it explicitly in LocalSettings.php.
  • In MW 1.22, the default value appears to have become '/usr/bin/php', pointing to a file which does not exist, hence the error message above. Explicitly reverting to a value of 'php' woukd appear to solve the issue.

Is that correct?

Ciencia Al Poder ( talk contribs )

It was changed to /usr/bin/php even before than 1.19.

You can change $wgPhpCli in your LocalSettings if you need to, that's fine if that solves your problem.

Cavila ( talk contribs )

Thanks for responding. There have not been any issues on my MW 1.19.7 installation, so something else must be involved. But at least the error message no longer shows up.

Sophivorus ( talk contribs )

Had the same problem in 1.23alpha installations and fixed it by setting $wgPhpCli = 'php';

122.101.20.5 ( talk contribs )

Thanks for Fix it.

Before:global $wgJobRunRate, $wgPhpCli, $IP;   ... 639 Line
After:global $wgJobRunRate, $wgPhpCli, $IP;    ...639 Line
             $wgPhpCli = 'php';               ...640 Line
Benby ( talk contribs )

Adding $wgPhpCli = 'php'; to /wiki/LocalSettings.php worked on my configuration as well. Thanks for sharing.

(In my LocalSettings.php I actually had to add a new line for $wgPhpCli. Searching for that variable only gave me occurences in DefaultSettings.php - just an addition which may help other MediaWiki newbies like me.)

Cavila ( talk contribs )

There may be a catch though. I now have a job queue of well over a million. Does MW somehow need this to run jobs?

Cavila ( talk contribs )
Narcisgarcia ( talk contribs )

MWException: PEAR mail package is not installed even after installing it and checking include path - fedora server (using dnf package)

4
Reesericdotci ( talk contribs )

I am getting a strange pear mail error after installing it on Fedora Server and checking the include path through following the checklist on PEAR's site. Here's all the debug info I got:


Webpage:

[3b4977d818b6fe8f04e8b74a] /index.php?title=Special:ConfirmEmail MWException: PEAR mail package is not installed

Backtrace:

from /usr/share/mediawiki/includes/mail/UserMailer.php(369)

# 0 /usr/share/mediawiki/includes/mail/UserMailer.php(173): UserMailer::sendInternal()

# 1 /usr/share/mediawiki/includes/user/User.php(3068): UserMailer::send()

# 2 /usr/share/mediawiki/includes/user/User.php(3042): User->sendMail()

# 3 /usr/share/mediawiki/includes/specials/SpecialConfirmEmail.php(145): User->sendConfirmationMail()

# 4 /usr/share/mediawiki/includes/htmlform/HTMLForm.php(729): SpecialConfirmEmail->submitSend()

# 5 /usr/share/mediawiki/includes/htmlform/HTMLForm.php(619): HTMLForm->trySubmit()

# 6 /usr/share/mediawiki/includes/htmlform/HTMLForm.php(635): HTMLForm->tryAuthorizedSubmit()

# 7 /usr/share/mediawiki/includes/specials/SpecialConfirmEmail.php(118): HTMLForm->show()

# 8 /usr/share/mediawiki/includes/specials/SpecialConfirmEmail.php(79): SpecialConfirmEmail->showRequestForm()

# 9 /usr/share/mediawiki/includes/specialpage/SpecialPage.php(701): SpecialConfirmEmail->execute()

# 10 /usr/share/mediawiki/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()

# 11 /usr/share/mediawiki/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()

# 12 /usr/share/mediawiki/includes/MediaWiki.php(904): MediaWiki->performRequest()

# 13 /usr/share/mediawiki/includes/MediaWiki.php(562): MediaWiki->main()

# 14 /usr/share/mediawiki/index.php(49): MediaWiki->run()

# 15 /usr/share/mediawiki/index.php(45): wfIndexMain()

# 16 {main}


pear version:

PEAR Version: 1.10.15

PHP Version: 8.2.18

Zend Engine Version: 4.2.18

Running on: Linux localhost.localdomain 6.8.9-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May? 2 18:44:19 UTC 2024 x86_64


pear list:

Installed packages, channel pear.php.net:

=========================================

Package ? ? ? ?? Version State

Archive_Tar ? ?? 1.5.0 ? stable

Auth_SASL ? ? ?? 1.2.0 ? stable

Console_Getopt ? 1.4.3 ? stable

Mail ? ? ? ? ? ? 2.0.0 ? stable

Mail_Mime ? ? ?? 1.10.12 stable

Net_SMTP ? ? ? ? 1.12.1? stable

Net_Socket ? ? ? 1.2.2 ? stable

PEAR ? ? ? ? ? ? 1.10.15 stable

PEAR_Manpages ?? 1.10.0? stable

Structures_Graph 1.1.1 ? stable

XML_Util ? ? ? ? 1.4.5 ? stable


ls -lah on /usr/share/pear:

drwxrwxr-x.? 11 caddy apache 4.0K May 20 20:59 pear

ls -lah on /usr/share/pear/

drwxrwxr-x. ? 2 caddy apache? 162 May 20 20:59 Mail


php.ini

;;;;;;;;;;;;;;;;;;;;;;;;;

; Paths and Directories  ;

;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX : "/path1 : /path2"

include_path = ".:/usr/share/pear/"


the pear bool was true when checking, and the include path included pear when using check_php

Samwilson ( talk contribs )

@ Reesericdotci : You shouldn't install PEAR globally for it to be used by MediaWiki, it's in the MW vendor / directory already along with all other PHP dependencies. How did you install MediaWiki? You may need to either make sure you've downloaded all submodules, or run composer update -- no - dev - o .

Reesericdotci ( talk contribs )

I installed MediaWiki using `sudo dnf install mediawiki` - I can try symlinking to vendor maybe?

Reesericdotci ( talk contribs )

Alright, running composer update --no-dev -o in /var/www/wiki worked for me - thank you!

Wladek92 ( talk contribs )

i activate numbering of paragraphs in my user preferences. Then when displaying the page itself numbering is:

Sommaire
1 2 Welcome to MediaWiki.org help pages
2.1Reading
2.2Editing
2.3Advanced editing
2.4Collaboration
2.5Personal customization
2.6Wiki administration

Strange: There is nothing between level 1 and level 2 on first line and all is under level 2.

Then making modify source + preview with a forced TOC, all is under level 1:

Sommaire
1Welcome to MediaWiki.org help pages
1.1Reading
1.2Editing
1.3Advanced editing
1.4Collaboration
1.5Personal customization
1.6Wiki administration

Can someone analyse and correct the display  ? Thanks. -- Christian ???? FR ( talk ) 09:04, 18 May 2024 (UTC)

Malyacko ( talk contribs )

What "page itself"? Please provide clear and full steps to reproduce something somewhere, including URLs.

Wladek92 ( talk contribs )

it is written in the title, read the complete topic please. -- Christian ???? FR ( talk ) 08:39, 20 May 2024 (UTC)

TheDJ ( talk contribs )

This might have something to do with the change of the heading structure that is rolling out. Although I have proper spacing between the numbers and the titles. I suggest we wait a week or so more, before fixing this to allow changes to settle down.

Wladek92 ( talk contribs )

thanks sometimes things appear strange to me, so I just warn. --Christian ???? FR (talk) 10:18, 21 May 2024 (UTC)

Reply to "strange section indentation Help:Contents"

Error after update MW: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s)

3
Summary by Fanatikvoice

Specify for PHP processing which method to use in your control panel - Apache or CGI. If it is Apache, select CGI.

Fanatikvoice ( talk contribs )

Hi, i update MW and moved the site from hosting to VDS. Now i get this is error: I moved the site from Warning: is_dir(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/www-root/data:.) in =/var/www/www-root/data/www/ih1344788.vds.myihor.ru/includes/libs/filebackend/fsfile/TempFSFile.php on line 90

How the fixed error? I've read about this PHP parameter and can't figure out what to do.

Fanatikvoice ( talk contribs )

Problem Fixed.

Results: Specify for PHP processing which method to use in your control panel - Apache or CGI. If it is Apache, select CGI.

Reply to "Error after update MW: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s)"

upload_tmp_dir - MediaWiki ignores php specified path

8
Arkasha ( talk contribs )

MediaWiki 1.17wmf1
PHP 5.2.12 (apache)
MySQL 5.0.90-log

There is a problem with a temporary folder path resolving.
Php on server side sets this directive as following:
upload_tmp_dir = /home/XXXXX/hdlwiki.com/tmp
and
open_basedir = /home/XXXXX/
However Wiki ignores these directives and tries to use /var/tmp
which is out of the allowed path.
This warning I received during Wiki installation:

     Warning: is_dir() [function.is-dir]: open_basedir restriction in effect.

File(/tmp) is not within the allowed path(s): (/home/XXXXX/) in /home/XXXXX/hdlwiki.com/www/config/Installer.php on line 474 Warning: Your session.save_path value (/tmp) appears to be invalid or is not writable.
PHP needs to be able to save data to this location for correct session operation.

As a result I cannot upload files by url. The system returns an error:

     Warning:  tempnam() [<a href='function.tempnam'>function.tempnam</a>]: open_basedir restriction in effect.

File(/var/tmp/) is not within the allowed path(s): (/home/XXXXX/)in/home/XXXXX/hdlwiki.com/www/includes/upload
/UploadFromUrl.php on line 101

What can be a solution for such problem.

Bawolff ( talk contribs )

Set the TMP (or TEMP or TMPDIR) environment variables for what you want your temp directory. (for the upload by url error)

For the install error, this can be caused if php is configured to store session files in the temp directory (sesssion.save_path in your php.ini). This should cause logins to not work at all, but perhaps only mediawiki is dissallowed, and php session handlers don't have the open_basedir restriction. If you get that warning when installing, but can still log in after the install is done, then the warning is in error, and is a bug in the installer (should probably file a bug about it).

Arkasha ( talk contribs )

Where should I set TMP variable? I have these in my LocalSettings.php

$wgEnableUploads  = true;
$wgAllowCopyUploads = true;
$wgUploadPath = "{$wgScriptPath}/images";
$wgUploadDirectory = "{$IP}/images";
$wgTmpDirectory = "{$wgUploadDirectory}/temp";

$wgGroupPermissions['sysop']['upload_by_url'] = true;

and I still have the above mentioned error. The folders for uploads are all writable. The Special:Upload shows Could not create temporary file. in red.

Bryan ( talk contribs )

putenv("TMP={$wgUploadDirectory}/temp");

UploadFromUrl appears to not support wgTmpDirectory, I believe this is a bug.

Bawolff ( talk contribs )

Really I'd consider it a bug in wfTempDir() function. Imports, and diffs (depending on config) are also affected.

Arkasha ( talk contribs )

Thank you! This solved the problem. Can it be fixed in the following MW release?

Bryan ( talk contribs )

Dunno if the fix will make it into 1.17, but in 1.18 it most likely will.

Narcisgarcia ( talk contribs )

I still see the problem in MediaWiki 1.41.1

The only workaround is to add

$wgTmpDirectory = ini_get('upload_tmp_dir');

to LocalSettings.php

Reply to "upload_tmp_dir - MediaWiki ignores php specified path"