Project:Support desk

Jump to navigation Jump to search

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(Read this message in a different language)

See also

Other places to ask for help:

Before you post

Post a new question

  1. To help us answer your questions, please indicate which versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. 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.
  3. To start a new thread, click "Start a new topic".

Best 14 Types of Indian Jewellery Designs ?

1
Navkkar Jewellers (talkcontribs)
Reply to "Best 14 Types of Indian Jewellery Designs ?"

How to run custom PHP over MediaWiki

6
182.232.50.87 (talkcontribs)

I have created a PHP file which loads an HTML-frontend custom-developed "call now" position:absolute "sticky" button module.

I want to run that PHP file every time a MediaWiki page is loaded, so that this custom developed module would be loaded for each MediaWiki page and thus available to any user on any webpage in my website.


How can this be done?

Jonathan3 (talkcontribs)

If you really need to add PHP to each page you could edit the skin - /skins/Vector/includes/VectorTemplate.php maybe?

If you just need to add a button to each page maybe you could use MediaWiki:Sitenotice (see Manual:Interface/Sitenotice). If the button has HTML/Javascript that can't usually go on a wiki page you could try Extension:Widgets or similar.

182.232.50.87 (talkcontribs)

@Jonathan3

I have actually created two PHP modules, one is a contact form and one is a the "call now".

I can access the contact form by example.com/contact_form/contact_form.php but in contrast, example.com/call_now/call_now.php is of course something which is not a standalone webpage, rather just a caller for some HTML-CSS.


I can understand why you recommend to edit a skin's main PHP file; in theory I could paste all the PHP code currently in call_now.php inside the skin's main PHP file but the problem with that is that it each time I would upgrade MediaWiki I would have to re-paste it there again.


I think that what I need is to to execute my code from within MediaWiki GUI somehow (just as I paste JavaScript in Common.js and CSS in Common.css).

Jonathan3 (talkcontribs)

Could you not just add an include line to the skin?

Jonathan3 (talkcontribs)

What is the HTML/CSS in the "call now" button?

182.232.50.87 (talkcontribs)

@Jonathan3 sure I could but I aspire to untouch the skin's PHP (Maybe I should add such in include in LocalSettings.PHP?).

The HTML for basic functionality is:

main_box.php

<!DOCTYPE html>
<html>
	<head>
		<?php
			include './assets/assets.php';
		?>
	</head>
	<body>
		<div dir="rtl" class="cacb_main_box">
			<?php
				include './phone_box.php';
				include './email_box.php';
			?>
		</div>
	</body>
</html>

phone_box.php

<!DOCTYPE html>
<html>
	<head>
		<?php
			include './assets/assets.php';
		?>
	</head>
	<body>
        <div class="cacb_phone_box">
            <a class="cacb_phone_link" href="tel:URI">
                <img class="cacb_phone_icon" src="./images/VECTOR.svg"></img>
                <span class="cacb_phone_text">Call now</span>
            </a>
        </div>
	</body>
</html>
Reply to "How to run custom PHP over MediaWiki"

Need some help with upgrading mediawiki

13
Pritesh j thakkar (talkcontribs)

We are currently running following version, plan is to move mediawiki to CentOS 7 and upgrade mediawiki. Can you please guide me which version I should upgrade to first before latest LTS version ? and how can i upgrade it ?

Product Version
MediaWiki 1.15.4
PHP 5.3.3 (apache2handler)
MySQL 5.1.73

Thanks,

Fokebox (talkcontribs)

First of all try to follow official guidance on upgrading. If you face any difficulties, drop a message here.

P.S. I believe you will have some difficulties as you MW version extremely old, so probably you should ugrade step by step to newer version like from 1.15. to 1.20 to 1.25 to 1.30. etc.

Pritesh j thakkar (talkcontribs)

@Jonathan3 @Fokebox

Can you please have a look at following approach and tell me if I should be doing it differently ?

- I have built new centos 7 server and installed following packages :

httpd php php-mysql php-gd mariadb-server php-xml php-intl mysql

- export db from old server, and import it on new server, bring mediawiki code (/var/www/wiki) and save it on new server

- After 1.15 next LTS version is 1.19 so download that code. Backup existing mediawiki dir, untar new mediawiki release, copy LocalSettings.php from backup and test

Is there any document I can follow for step upgrade ?

Jonathan3 (talkcontribs)
Jonathan3 (talkcontribs)

Yes, there's a new note on that page saying: "Since Version 1.36, MediaWiki only commits to supporting upgrades from two LTS releases ago (see phab:T259771). Upgrades from older versions of MediaWiki will have to be performed in multiple steps. This means that if you want to upgrade to 1.36 from 1.23 or earlier, you'll first have to upgrade your 1.23 wiki to 1.27 (or 1.35), and, from 1.27 (or 1.35), you'll be able to upgrade to 1.36."

Jonathan3 (talkcontribs)

Looking at it again, to me this sentence is nonsense (i.e. I can't make sense of it!)

[Edit, since indentation didn't work as I had expected: I mean the sentence beginning "Since Version 1.36, MediaWiki only commits to supporting upgrades from two LTS releases ago..."]

Looking at task T259771, it says: "Also, everything up to 1.35 can still be done in one step. So someone who, in four years, wants to upgrade from 1.29 to 1.43, will have to do two steps: one to 1.35, and one to 1.43. To upgrade to 1.50 in seven years, you'd go from 1.29 to 1.35 (2020), then to 1.43 (2024), and finally to 1.50 (2027). Not too terrible, I think."

So it looks like you could go straight from 1.15 to 1.35. You couldn't go from 1.15 to 1.36 though. You might as well go straight to 1.35, then 1.36, as then you don't have to mess around with different PHP versions etc.

This post was hidden by Pritesh j thakkar (history)
Jonathan3 (talkcontribs)

Maybe that's a php version thing. You don't need to move the old wiki php files across. Just the database plus a selection of files (localsettings.php etc). You download the new mediawiki files from the tarball, then copy across those selected files.

Pritesh j thakkar (talkcontribs)

@Jonathan3 @FokeboxI just tried to upgrade to mediawiki-1.35.3.tar.gz, but now home page isn't displaying (blank page). And php update.php, is not showing any output and exit code is 255.

I have upgraded php to PHP 7.4.23, can you please advise how I can fix that ?


Thanks,

Jonathan3 (talkcontribs)

I'm only another user. But what exactly have you done (ie every step)?

Pritesh j thakkar (talkcontribs)

I have documented steps as I was upgrading it :


tar -xvzf ~pritha1/mediawiki-1.35.3.tar.gz

mv mediawiki-1.35.3/ wiki

cp -ip wiki_WORKING/LocalSettings.php wiki

cp -prv ../wiki_WORKING/images .

php update.php

PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/wiki/maintenance/update.php on line 131

php --version

PHP 5.4.16 (cli) (built: Apr  1 2020 04:07:17)

Copyright (c) 1997-2013 The PHP Group

Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

After upgrading

[root@psapql427 yum.repos.d]# php --version

PHP 7.4.23 (cli) (built: Aug 24 2021 16:33:30) ( NTS )

Copyright (c) The PHP Group

Zend Engine v3.4.0, Copyright (c) Zend Technologies

[root@psapql427 maintenance]# php update.php

Error: Missing one or more required components of PHP.

You are missing a required extension to PHP that MediaWiki needs.

Please install:

* mbstring <https://www.php.net/mbstring>

yum install php74-php-mbstring.x86_64

php update.php

echo $?

255

I really appreciate for helping me with it.

Thanks,

Jonathan3 (talkcontribs)

This is a wild guess, but maybe the update script did some stuff during the first two attempts, and its half-done job is now causing problems.

Until you hear form someone else, what about just starting from scratch (i.e. copy across your database, new MW 1.35 files, and LocalSettings and images, then run update.php)?

Or what about commenting out all the extension lines in LocalSettings.php? That changed from "include" to "wfLoadExtension".

Or what about installing a brand new MW1.35 purely to obtain a new LocalSettings.php file? Then using that to recreate one for your actual wiki. Maybe something important has changed. I think a few old lines I had left over from MW1.5 or so caused me trouble recently.

Pritesh j thakkar (talkcontribs)

I have uninstalled PHP7.4 and refreshed db again and mediawiki 1.15 is working again.

"new MW 1.35 files, and LocalSettings and images, then run update.php)? " do I need to upgrade Php before doing that ?

php --version

PHP 5.4.16 (cli) (built: Apr  1 2020 04:07:17)

Reply to "Need some help with upgrading mediawiki"
Thatnewman (talkcontribs)

Hello how do i install Module on my Wiki??

Malyacko (talkcontribs)
Thatnewman (talkcontribs)

It is showing Internal error after installation

Jonathan3 (talkcontribs)
Reply to "How do I install Module"

How can i create all these stuff on my wiki

2
Thatnewman (talkcontribs)
Jonathan3 (talkcontribs)
Reply to "How can i create all these stuff on my wiki"

Upgrading mediawiki from 1.15 to 1.35.3, php update.php isn't showing any output

2
Pritesh j thakkar (talkcontribs)

Topic:Wgjkdu5fvl1ebue9

I am trying to upgrade, and have installed necessary packages, mediawiki but when I run php update.php isn't showing any output.

php update.php

echo $?

255

Can you please help if you have ever seen this kind of behavior before ?

Thanks,

Jonathan3 (talkcontribs)

This is pretty much the same question as in the other topic.

Reply to "Upgrading mediawiki from 1.15 to 1.35.3, php update.php isn't showing any output"

WikiFamily creation user problems

2
Summary by Fokebox

The problem remains

Fokebox (talkcontribs)

Hello dear Team.

I have a wikifamuly made just like wikipedia. I set up wiki with different localisations: ru.wikijournal - Russian wiki, en.wikijournal.org - english wiki etc.

After upgrading wiki to 1.35. I noticed that there is problems with user account creation. I mean that if you are creating user at ru.wikijournal.org, it does not create account in other localisations and vice versa creating for example at en.wikijournal.org it does not create account in other localisations. I have following set upo at Localsettings.php:

# MySQL specific settings
$wgDBprefix = "ru__";

# Single Sign On (one entry point for all wikis)
$wgSharedDB = "wikijournal_org"; 
$wgSharedPrefix = "ru__"; 
$wgCookieDomain = '.wikijournal.org';

# Shared tables
$wgSharedTables[] = 'interwiki';
$wgSharedTables[] = 'ipblocks';
$wgSharedTables[] = 'user_groups';

So, previously at wiki 1.30. all worked fine, but after upgrading something happened and I have creation user problems described above. Could someone help me to resolve the issue? What can I try?

Fokebox (talkcontribs)

The problem remains. What is interesting all users registered before upgrade can log in without problems, but new registered users can log in at localisation where they are registered. I believe the problem with $wgSharedTables[] = 'user_groups'; Anyway I appreciate if you help me to resolve the problem.

Reply to "WikiFamily creation user problems"
Pooja2425 (talkcontribs)

Hi,

<pdf width="780" height="560">Flow_charts.pdf</pdf>

Please suggest me which extension i have to use to work if we include pdf in this type. Its working in Version 1.31 . But not working in v 1.35.3.

Osnard (talkcontribs)
Pooja2425 (talkcontribs)

HI ,

Product Version
MediaWiki 1.35.3
PHP 7.4.23 (apache2handler)
MySQL 8.0.26
Lua 5.1.5
Elasticsearch

when using PDFEmbed giving error " Call to undefined method Parser::disableCache() ", error given below.

<pdf height=800 width=800>CARBONATE_SEISMIC_CHECKLIST.pdf</pdf>

<embed>CARBONATE_SEISMIC_CHECKLIST.pdf</embed>


same file coming with simple embed extension, but not from <pdf> tag.

since we are using <pdf></pdf> tag into 1000+ pages. we cannot change manually.

pls suggest any supporting extension to support <pdf></pdf> tag.


or give working extenison PDFEmbed.

[YUNWMeVcOnGQwRm0xefEugAAAAI] /wiki/index.php/Discipline/Prospect_evaluation Error from line 39 of /data/www/html/wiki/extensions/PDFEmbed/PDFEmbed.hooks.php: Call to undefined method Parser::disableCache()

Backtrace:

#0 /data/www/html/wiki/includes/parser/Parser.php(3922): PDFEmbed::generateTag()

#1 /data/www/html/wiki/includes/parser/PPFrame_Hash.php(330): Parser->extensionSubstitution()

#2 /data/www/html/wiki/includes/parser/Parser.php(2887): PPFrame_Hash->expand()

#3 /data/www/html/wiki/includes/parser/Parser.php(1556): Parser->replaceVariables()

#4 /data/www/html/wiki/includes/parser/Parser.php(651): Parser->internalParse()

#5 /data/www/html/wiki/includes/content/WikitextContent.php(374): Parser->parse()

#6 /data/www/html/wiki/includes/content/AbstractContent.php(590): WikitextContent->fillParserOutput()

#7 /data/www/html/wiki/includes/Revision/RenderedRevision.php(263): AbstractContent->getParserOutput()

#8 /data/www/html/wiki/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()

#9 /data/www/html/wiki/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()

#10 /data/www/html/wiki/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()

#11 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()

#12 /data/www/html/wiki/includes/Revision/RenderedRevision.php(197): call_user_func()

#13 /data/www/html/wiki/includes/poolcounter/PoolWorkArticleView.php(216): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()

#14 /data/www/html/wiki/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()

#15 /data/www/html/wiki/includes/page/Article.php(810): PoolCounterWork->execute()

#16 /data/www/html/wiki/includes/actions/ViewAction.php(74): Article->view()

#17 /data/www/html/wiki/includes/MediaWiki.php(527): ViewAction->show()

#18 /data/www/html/wiki/includes/MediaWiki.php(313): MediaWiki->performAction()

#19 /data/www/html/wiki/includes/MediaWiki.php(940): MediaWiki->performRequest()

#20 /data/www/html/wiki/includes/MediaWiki.php(543): MediaWiki->main()

#21 /data/www/html/wiki/index.php(53): MediaWiki->run()

#22 /data/www/html/wiki/index.php(46): wfIndexMain()

#23 {main}

Reply to "Pdf issue"

Is there a way to totally disable sidebar menu?

5
182.232.50.87 (talkcontribs)

MediaWiki 1.36.1 with Timeless and one sidebar menu.

I have two links in my sidebar menu: One is to the homepage and one is to the contact page.

  • A link to my homepage is already available from my site's name (#p-logo-text > p-banner) so the navigation link to the homepage causes some kind of a duplication
  • I think to put a sticky HTTP link to the contact page from the bottom part of the screen display which will appear in every page as an alternative to the navigation page link

Is there a way to totally disable sidebar menu?

Not just by CSS but from PHP?

Jonathan3 (talkcontribs)

I'm sure it is (likely there'll be a file in skins/timeless that you can just delete a chunk of). There are skins designed without sidebars too: https://skins.wmflabs.org/#/

182.232.50.87 (talkcontribs)

Thank you, I try to work all-core because it makes my upgrades much easier.

Jkhan12 (talkcontribs)

Our MediaWiki is version 1.32, and most of the available extensions, such as PluggableSSO, PluggableAuth, SimpleSAMLPhp, and OpenIdConnect, do not support it.

Jonathan3 (talkcontribs)
Reply to "Is there a way to totally disable sidebar menu?"

Mediawiki 1.32 version not available in most of the extension

4
Frizzow (talkcontribs)

Our MediaWiki is 1.32 version and most of the extension available such as PluggableSSO, PluggableAuth, SimpleSAMLPhp and OpenIdConnect etc are not offering the version. What would be the most compatible and safer version i should choose? We would like to configure SSO for our on-prem server and hope that it wouldn’t cause much trouble if we are using a different ver. Appreciate your help!!

Jonathan3 (talkcontribs)

Pick one from here: Version lifecycle.

Depends on extension compatibility and how often you plan to upgrade :-)

Bawolff (talkcontribs)

Often you can get older versions of extensions at github. However we do reccomend you use a recent version of mediawiki.

Jonathan3 (talkcontribs)

If I were advising myself I'd say stick with one of the LTS versions, but only upgrade to it at the last safe moment so that your extensions and skin likely will have been upgraded too. I'm still on 1.34 as when I had the time to upgrade to 1.35 nothing seemed to work with it, and now that everything works I don't have the time :-)

Reply to "Mediawiki 1.32 version not available in most of the extension"