Project:Support desk
Jump to navigation
Jump to search
Reply to "How to run custom PHP over MediaWiki"
Reply to "Need some help with upgrading mediawiki"
Reply to "How do I install Module"
Reply to "How can i create all these stuff on my wiki"
Reply to "Upgrading mediawiki from 1.15 to 1.35.3, php update.php isn't showing any output"
Reply to "WikiFamily creation user problems"
Reply to "Pdf issue"
Reply to "Is there a way to totally disable sidebar menu?"
Reply to "Mediawiki 1.32 version not available in most of the extension"
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?
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.
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).
Could you not just add an include line to the skin?
What is the HTML/CSS in the "call now" button?
@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>
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,
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.
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 ?
I wouldn't want to comment in case you've missed something! Just follow the instructions at Manual:Upgrading and you'll be all right. I guess you'd need to ensure that you've got the right PHP/database versions for each intermediate version: Compatibility. Other useful pages might be Manual:Moving a wiki, Manual:Running MediaWiki on Red Hat Linux and Manual:Restoring a wiki from backup.
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."
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)
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.
@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,
I'm only another user. But what exactly have you done (ie every step)?
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,
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.
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)
Hello how do i install Module on my Wiki??
It is showing Internal error after installation
Check out Extension:Scribunto#Troubleshooting. There are a few different internal error messages there.
- Wikipedia:Main Page/Tomorrow (view source) (protected)
- Wikipedia:Main Page/styles.css (view source) (protected)
- Wikipedia:Selected anniversaries/September 16 (edit)
- Wikipedia:Selected anniversaries/September 17 (edit)
- Wikipedia:Today's featured article/September 16, 2021 (edit)
- Wikipedia:Today's featured article/September 17, 2021 (edit)
- Wikipedia:Today's featured list/September 17, 2021 (edit)
- Template:-? (view source) (template editor protected)
- Template:Abbr (view source) (template editor protected)
- Template:Born and died list (view source) (protected)
- Template:DYKbotdo (view source) (protected)
- Template:Did you know (view source) (protected)
- Template:Did you know/Queue/3 (view source) (protected)
- Template:Did you know/Queue/Next (view source) (protected)
- Template:Hlist (view source) (template editor protected)
- Template:If empty (view source) (template editor protected)
- Template:In the news (view source) (protected)
- Template:In the news/footer (view source) (protected)
- Template:Main Page banner (view source) (protected)
- Template:Main Page interwikis (view source) (protected)
- Template:Main page image (view source) (template editor protected)
- Template:Main page image/DYK (view source) (protected)
- Template:Main page image/ITN (view source) (protected)
- Template:Main page image/OTD (view source) (protected)
- Template:Main page image/TFA (view source) (protected)
- Template:Mbox (view source) (protected)
- Template:Nowrap (view source) (protected)
- Template:Other areas of Wikipedia (view source) (protected)
- Template:POTD/2021-09-15/1 (edit)
- Template:POTD/2021-09-15/4 (edit)
- Template:POTD protected/2021-09-16 (edit)
- Template:POTD protected/2021-09-17 (edit)
- Template:POTD texttitle (view source) (protected)
- Template:Remove file prefix (view source) (template editor protected)
- Template:SelAnnivAbbr (view source) (template editor protected)
- Template:SelAnnivFooter (view source) (protected)
- Template:Str endswith (view source) (template editor protected)
- Template:Str number/trim (view source) (template editor protected)
- Template:TFAFULL (view source) (protected)
- Template:TFAfooter (view source) (protected)
- Template:TFArecentlist (view source) (protected)
- Template:TFL full list (view source) (protected)
- Template:TFLcontent (view source) (protected)
- Template:TFLfooter (view source) (protected)
- Template:TFLrecentlist (view source) (protected)
- Template:Wikipedia's sister projects (view source) (protected)
- Template:Wikipedia's sister projects/styles.css (view source) (protected)
- Template:Wikipedia languages (view source) (protected)
- Template:Wikipedia languages/core (view source) (protected)
- Template:Wikipedia languages/styles.css (view source) (protected)
- Template:`s (view source) (template editor protected)
- Module:Arguments (view source) (protected)
- Module:If empty (view source) (template editor protected)
- Module:List (view source) (template editor protected)
- Module:Main page image (view source) (protected)
- Module:Message box (view source) (protected)
- Module:Message box/configuration (view source) (protected)
- Module:No globals (view source) (protected)
- Module:Random (view source) (template editor protected)
- Module:String (view source) (protected)
- Module:TableTools (view source) (protected)
- Module:Yesno (view source) (protected)
I think you could use wikipedia:Special:Export
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,
This is pretty much the same question as in the other topic.
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?
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.
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.
Looks like Extension:PDFEmbed, which states it is compatible to MediaWiki 1.35.
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}
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?
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/#/
Thank you, I try to work all-core because it makes my upgrades much easier.
Our MediaWiki is version 1.32, and most of the available extensions, such as PluggableSSO, PluggableAuth, SimpleSAMLPhp, and OpenIdConnect, do not support it.
"Not just by CSS but from PHP?"
I think this is the file you need to edit - https://github.com/wikimedia/mediawiki-skins-Timeless/blob/master/includes/TimelessTemplate.php (i.e. edit the copy on your server).
Just start deleting stuff and see what happens!
Make a note so that you can do it again when you upgrade :-)
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!!
Pick one from here: Version lifecycle.
Depends on extension compatibility and how often you plan to upgrade :-)
Often you can get older versions of extensions at github. However we do reccomend you use a recent version of mediawiki.
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 :-)