Project:Support desk

Jump to navigation Jump to search

About this board

vde   Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to askCommunication: IRCCommunication#Chat, mailing listsMailing lists, Wikimedia Developer Support, Q&A, mwusers (unofficial forum) etc.

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
Joshua Tan JT (talkcontribs)

Hi there,

Does anyone know if i can divide my page into 3, preferably horizontally.

Thank you!

Malyacko (talkcontribs)

You could write custom CSS or use a table.

Joshua Tan JT (talkcontribs)

May I know how do i go about doing the custom CSS?

Reply to "Split Pages"
131.170.239.13 (talkcontribs)

I found a copy-cat website that is literally a wikipedia browser but with ads. Surely this is a copyright infringement or something, right? https://wikivisually.com

Reply to "Wikipedia stolen"

[RESOLVED] Unknown error in PHP's mail() function

6
Kmacdowe (talkcontribs)

MediaWiki: 1.23.5 PHP: 5.5.9-1ubuntu4.4 (apache2handler) MySQL: 5.5.40-0ubuntu0.14.04.1

I installed a new wiki. It is working fine other than it fails at sending email. For example when I ask it to send a confirmation email I get the following error:

"4MI Wiki could not send your confirmation mail. Please check your email address for invalid characters. Mailer returned: Unknown error in PHP's mail() function."

Or when I try to create a new account and have a random password sent to the user I get this error: "Account creation error Error sending mail: Unknown error in PHP's mail() function."

Florianschmidtwelzow (talkcontribs)
Kmacdowe (talkcontribs)

The solution was to remove a line from the PHP configuration file that was redundantly calling a PHP module that was already called from a different config file. Sorry I don't have the specifics at hand right now. Advice to others that have this problem: try sending mail from the CLI, if you get an error, fix that and then try sending from your wiki again. Thanks Florianschmidtwelzow for the help.

Foudfou (talkcontribs)
Jabbott (talkcontribs)

If you are running CentOS7 (or the equivalent Redhat) running SEL, you may have to turn on the ability of apache to send mail. See if this is set to allow or disallow by running the following command:
getsebool -a | grep mail
If you get the following response:
allow_postfix_local_write_mail_spool --> off
Then you will get the Unknown error. You will need to turn on this ability in the OS by the following command:
setsebool -P httpd_can_sendmail on
This should cure the error.

Kmacdowe (talkcontribs)
Reply to "[RESOLVED] Unknown error in PHP's mail() function"

Parse error: Unexpected "$wikiId" in Localsettings.php

53
Newman2 (talkcontribs)

MediaWiki Version: 1.30

PHP Version: 5.6.36 (litespeed)

MySQL Version: 5.6.39-cll-lve

ICU Version: 57.1

Hello. When I attempted to set up a wiki family on the Localsettings.php of my wiki, I get an error with the following message: PHP Parse error:  syntax error, unexpected '$wikiId' (T_VARIABLE) in /home/gjlxrtap/public_html/mw19/LocalSettings.php on line 259. The code that caused the error while attempting to create the wiki family is:

if ( defined( 'gjlxrtap_pnwiki' ) ) {

''// Set $wikiId from the defined constant 'MW_DB' that is set by maintenance scripts.''

$wikiId = penguinicewiki;

} elseif (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == 'wiki1.example.org') {

''// Add a value to the $wikiId variable for e.g. https://wiki1.example.org/''

$wikiId = 'wiki1';

} else {

''// Fail gracefully if no value was set to the $wikiId variable, i.e. if no wiki was determined''

die( 'It was not possible to determine the wiki ID.' );

}

if ($wikiId == 'wiki1') {

    $wgSitename = "Penguingame Studio";

    $wgServer = "http://penguingamestudio.com";

    $wgLogo = "ExampleWiki_logo.png";

    $wgDBpassword = "we39585f7ha34";

    $wgSecretKey = "9348vhas589ytas35aurhgao94aywrotuhapw94u";

    $wgLanguageCode = 'en';

}if ($wikiId == 'wiki1') {

    $wgSitename = "Penguingame Studio";

    $wgServer = "http://penguingamestudio.com";

    $wgLogo = "ExampleWiki_logo.png";

    $wgDBpassword = "-----------------";

    $wgSecretKey = "------------------------------";

    $wgLanguageCode = 'en';

}

What can I do to fix this error? I have no idea on what to do here, I never expected to get errors like this. Thank you for reading.

Clump (talkcontribs)

Not sure which line is line # 259, but unless penguinicewiki is a predefined constant I would guess it's the line "$wikiId = penguinicewiki;", where you probably should've either assigned the MW_DB constant, or the string 'penguinicewiki'.

Newman2 (talkcontribs)

I changed it to MW_DB, and it still gives me the same error. And line 259 is the very line that should have the MW_DB constant.

Clump (talkcontribs)

Is "// Set $wikiId from the defined constant 'MW_DB' that is set by maintenance scripts." literally in your file? That is supposed to be a comment, not a string...

The error is because php is encountering a variable ($wikiId) in a place where it makes no sense. So something is syntactically wrong with your file.

Newman2 (talkcontribs)

The error actually occurs with the line that has the following: $wikiId = penguinicewiki

Ciencia Al Poder (talkcontribs)

Shouldn't that line be:

$wikiId = 'penguinicewiki';

?

Newman2 (talkcontribs)

I'm not sure whether the central wiki ID will work the same way with any ID, or if the wiki ID of penguinicewiki should be the same as the if ( defined( 'gjlxrtap_pnwiki' ).

2001:16B8:109A:6600:99CC:A011:191E:55A5 (talkcontribs)

In how far does that have to do with the syntax error, which PHP is throwing?

Does this syntax error go away, if you adjust the code as told by Ciencia?

Newman2 (talkcontribs)

If penguinicewiki would be an unexpected wiki ID, then what can I do to fix this?

星耀晨曦 (talkcontribs)

Looks like penguinicewiki is not a problem, because you got a PHP Parse error, if it is other error, you will get other type messages of the error. A PHP Parse error, mostly because of syntax errors in the code, have nothing to do with the logic of the application.

So you should check the context of the 259 line for syntax error first. If you can't check, you can also post the context of the 259 line here and let us check (pay attention to attach the line number).

Newman2 (talkcontribs)

Do you even notice that line 259 is $wikiId = penguinicewiki?

121.219.12.173 (talkcontribs)

Which is clearly invalid (should be a "string"), along with your comments being invalid syntax as already mentioned.

Clump (talkcontribs)

An error the parser encounters on line 259 could be caused by malformed code on a previous line. If on line 258 you literally have
"// Set $wikiId from the defined constant 'MW_DB' that is set by maintenance scripts."
then that is likely source of the syntax problem, as that is a string, not a comment. It should be
// Set $wikiId from the defined constant 'MW_DB' that is set by maintenance scripts.
Note the lack of quotes. Also note that you have several comment-lines wrapped in quotes.

Newman2 (talkcontribs)

I just removed the double apostrophes from the comments. Now it only fails gracefully with the following message: It was not possible to determine the wiki ID. What can I do to make it determine the wiki ID?

Clump (talkcontribs)

Not sure, but $wikiId = penguinicewiki; is almost certainly wrong. Try Ciencia's suggested fix:
$wikiId = 'penguinicewiki';
Also note that you have two if-blocks at the end, both testing whether the wikiId is 'wiki1' but doing different things.

Newman2 (talkcontribs)

I just fixed the penguinicewiki variable, and my wiki still fails with the code. What do I do then?

Newman2 (talkcontribs)

^Read above.

Samwilson (talkcontribs)

@Newman2: can you post your current LocalSettings config (same as you did above, but with the changes you've made since)?

Newman2 (talkcontribs)
if ( defined( 'MW_DB' ) ) {

// Set $wikiId from the defined constant 'MW_DB' that is set by maintenance scripts.

$wikiId = 'penguinicewiki';

} elseif (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] == 'en.penguingamestudio.com') {

// Add a value to the $wikiId variable for e.g. <nowiki>https://wiki1.example.org/</nowiki> 

$wikiId = 'wiki1';

} else {

// Fail gracefully if no value was set to the $wikiId variable, i.e. if no wiki was determined

die( 'It was not possible to determine the wiki ID.' );

}

if ($wikiId == 'wiki1') {

    $wgSitename = "Penguingame Studio";

    $wgServer = "<nowiki>http://penguingamestudio.com</nowiki>";

    $wgLogo = "ExampleWiki_logo.png";

    $wgDBpassword = "we39585f7ha34";

    $wgSecretKey = "9348vhas589ytas35aurhgao94aywrotuhapw94u";

    $wgLanguageCode = 'en';

}
Samwilson (talkcontribs)

You should use MW_DB to get the wiki ID if possible, and but apart from that it should be okay:

<?php
if ( defined( 'MW_DB' ) ) {
    $wikiId = MW_DB;
} elseif (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] === 'en.penguingamestudio.com') {
    $wikiId = 'wiki1';
} else {
    die( 'It was not possible to determine the wiki ID.' );
}
if ($wikiId === 'wiki1') {
    $wgSitename = "Penguingame Studio";
    $wgServer = "http://penguingamestudio.com";
    $wgLogo = "ExampleWiki_logo.png";
    $wgDBpassword = "we39585f7ha34";
    $wgSecretKey = "9348vhas589ytas35aurhgao94aywrotuhapw94u";
    $wgLanguageCode = 'en';
}
Ciencia Al Poder (talkcontribs)

Please change your secret key and database password on your server, because you've leaked it publicly

Newman2 (talkcontribs)

Done. I will try not to leak anymore of my passwords in the future. I also changed the penguinicewiki variable to MW_DB, and it didn't fix the issue with the wiki ID.

Samwilson (talkcontribs)

There must be an issue with determining the server name. If you var_dump($_SERVER['SERVER_NAME']); what do you see? Are you serving the wiki from en.penguingamestudio.com or penguingamestudio.com (I assume the former)?

I'm guessing the idea here is to have separate language subdomains with separate wikis, all running from the same MediaWiki directory? If so, you probably want to extract the language code from the domain name and use it as part of the wiki ID. You can then also use it to set things like $wgLanguageCode and $wgServer (after validating it of course).

Newman2 (talkcontribs)

I used var_dump and got the following error: string(19) "penguinicewikis.com" It was not possible to determine the wiki ID. I also serve my second wiki at en.penguingamestudio.com, with my central wiki located at penguinicewikis.com.

Samwilson (talkcontribs)

Okay, so you probably want something along the lines of the following (I've removed the passwords etc. just to make it clearer; you'll need to add them for each wiki).

<?php
if ( defined( 'MW_DB' ) ) {
    $wikiId = MW_DB;
} elseif (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] === 'penguinicewikis.com') {
    $wikiId = 'main';
} elseif (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] === 'en.penguingamestudio.com') {
    $wikiId = 'en';
} else {
    die( 'It was not possible to determine the wiki ID.' );
}
if ($wikiId === 'main') {
    $wgSitename = "Penguinice Wikis";
    $wgServer = "http://penguinicewikis.com";
    $wgLanguageCode = 'en';
}
if ($wikiId === 'en') {
    $wgSitename = "Penguingame Studio";
    $wgServer = "http://en.penguingamestudio.com";
    $wgLanguageCode = 'en';
}
Newman2 (talkcontribs)

I did it. I also have already listed the server and the script path in Localsettings.php outside of the wiki family code. I just got the following error: PHP Parse error:  syntax error, unexpected '<' in /home/gjlxrtap/public_html/mw19/LocalSettings.php on line 255

2001:16B8:101A:200:D1C3:3F7F:9E12:ABDC (talkcontribs)

In LocalSettings.php, on line 255, you have a "<" character, which does not belong there.

Honestly I don't know, what you are changing in the file.

Maybe you should first read an introduction to PHP before you go ahead - PHP can be rather picky about its syntax. You should read something about PHP syntax first!

Samwilson (talkcontribs)

@Newman2: Are you including the <?php part? That should be left out (it only goes at the top of LocalSettings, and you've probably already got it in that file). I'm sorry, I shouldn't have included it in the above code.

Newman2 (talkcontribs)

I removed the <?php part from the wiki family code and now my Penguin Ice Wikis site is up and running. However, en.penguingamestudio.com has not loaded when I go to the site. What do I need to do in order to get the en.penguingamestudio.com site up and running?

Samwilson (talkcontribs)

Do you get any error?

You firstly need to make sure that en.penguingamestudio.com is being mapped to the same MediaWiki directory.

Newman2 (talkcontribs)

No, I do not get any error on my main wiki. And by the way, how do I make sure that en.penguingamestudio.com is being mapped to the same MediaWiki directory?

This post was hidden by Newman2 (history)
Newman2 (talkcontribs)

^Read the post above.

Samwilson (talkcontribs)

> how do I make sure that en.penguingamestudio.com is being mapped to the same MediaWiki directory?

One easy way is to create a symlink from wherever it's being served from now to the other directory.

Or you can change your web server configuration to change the document root (e.g. for Apache, set something like DocumentRoot "/var/www/mediawiki").

Basically, it's nothing to do with MediaWiki itself, so you should be able to get the various domains pointing to the same directory on your server, and then after that work on configuring MediaWiki.

Newman2 (talkcontribs)

I have a question. Do I need to add a CommonSettings.php for global settings and separate LocalSettings files for each wiki? If so, do I need a separate database for each wiki? This could be why my Penguingame Studio wiki is not running.

EDIT: I also installed global userrights, and I loaded it into my CommonSettings.php file. When I loaded the extension and added steward rights to my Commonsettings.php file, it did not show up on penguinicewikis.com. The settings of penguinicewikis.com are located in my LocalSettings.php file.

This post was hidden by Newman2 (history)
Newman2 (talkcontribs)

^Read the post above.

Samwilson (talkcontribs)

(You don't need to keep saying "read the post above". It might come across as rude.)

> Do I need to add a CommonSettings.php for global settings and separate LocalSettings files for each wiki?

No, you can configure it all in LocalSettings if you wish, with conditional statements, or you can do something like this and have separate files:

require_once "$IP/LocalSettings_$wikiId.php";

Personally, I prefer having it all in one file, because there's only half a dozen lines that are unique to each wiki and they're easy enough to see when all together.

Did you get the other domain working?

Newman2 (talkcontribs)

I'm sorry about posting "Read the post above", I did it because I was afraid that people wouldn't read my post. And I've tried to get the other domain working, but the sites for my Penguingame Studio wikis can not be reached. And when I try to enable global extensions, it gives me an internal error.

Do I need to install any databases to get multiple wikis running? If none of the additional wikis could have their site reached, then what can I do to make my additional wikis up and running? It is hard for me to find a way to get this all set up on my own.

Samwilson (talkcontribs)

Okay, to get things started I recommend you don't worry about MediaWiki at all: just get both domains being served from the same place. Doesn't matter if that directory just contains a simple index.html file. Don't try to get the MediaWiki side of things sorted out until you've done the webserver part.

What web server are you using? Apache? What filesystem directories are set up as the document roots for the domains? e.g. they might be /var/www/penguinicewikis.com and /var/www/en.penguingamestudio.com . So you need to get both of these pointing to a single place, either by changing the web server config or setting up symlinks (etc.).

Does that make sense?

Newman2 (talkcontribs)

My web host managers said I can't directly manage the Apache configuration files, but I can define specific rules just for your domain using an .htaccess file. Also, I can't change the web server config.

Newman2 (talkcontribs)

I started a subdomain of penguinicewikis.com called Penguiconverter. I pointed it at the original file, but my site shows up as a duplicate of the original site. What can I do to make the data on the wiki separate from the other site?

Samwilson (talkcontribs)

Sounds good! So you've got two domains pointing to the same place. :) That's good. If you've got it working on the subdomain as the same site, then you must have changed LocalSettings.php to have a default DB name etc.; can you post your current config?

So next you need to sort out the configuration in LocalSettings.php — make sure you've got a config like I posted above, with the relevant subdomains in there.

Do you have a second database set up for the other wiki? If not, you can clone your existing working one with tables/structure only and no data. Are you using phpMyAdmin? There's a tool in there for doing that.

Newman2 (talkcontribs)

I cloned my database by importing, and the wiki hasn't become separate yet. I also tried to use require_once in Localsettings.php, and it gave me the following error: PHP Fatal error:  require_once(): Failed opening required '/home/gjlxrtap/public_html/mw19/LocalSettings_penguiconverter.php' (include_path='/home/gjlxrtap/public_html/mw19/vendor/pear/pear_exception:/home/gjlxrtap/public_html/mw19/vendor/pear/console_getopt:/home/gjlxrtap/public_html/mw19/vendor/pear/mail_mime-decode:/home/gjlxrtap/public_html/mw19/vendor/pear/net_smtp:/home/gjlxrtap/public_html/mw19/vendor/pear/pear-core-minimal/src:/home/gjlxrtap/public_html/mw19/vendor/pear/mail:/home/gjlxrtap/public_html/mw19/vendor/pear/mail_mime:/home/gjlxrtap/public_html/mw19/vendor/pear/net_socket:.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/gjlxrtap/public_html/mw19/LocalSettings.php on line 234

What can I do to remove that fatal error? Also, how can I make my new wiki have separate pages and files but still run successfully?

Ciencia Al Poder (talkcontribs)

> What can I do to remove that fatal error?

Seriously, the error is very explicative. Why are you adding PHP code to files without having any clue of what you're doing, and then asking why it doesn't work, if you don't even explain the rationale of adding random require_once?

Newman2 (talkcontribs)

I removed the require_once code and I currently will not remove it because I did not know how to fix it without help. I also want to know if the correct way to clone the old database is to export it and then import it into the new database, because my second wiki still shows the same pages and files as the original wiki.

Samwilson (talkcontribs)

You should export only the database structure, and not any data in it. Then, when setting up the new wiki you'll run:

php maintenance/update.php --wiki penguinconverter

And yeah, if you want to have separate LocalSettings files for each wiki, you'll have to actually create those files. But I'd recommend you keep things simple.

Newman2 (talkcontribs)

Wait... do I run that script with a web server like Apache? Or where do I run it?

Samwilson (talkcontribs)
Newman2 (talkcontribs)

I updated my Penguiconverter wiki, however when I uploaded a test file it showed up on both Penguiconverter and Penguin Ice Wikis. Do I need to create separate directories for images and pages? If not, what do I need to do to fix this?

Samwilson (talkcontribs)

Yeah, you could base this too on $wikiId, e.g.:

$wgUploadDirectory = "$IP/images_$wikiId";
$wgUploadPath = "/images_$wikiId";
$tmpDir = "/tmp/mediawiki_{$wikiId}_" . php_sapi_name();
Newman2 (talkcontribs)

Added the upload location. I also did a test edit on my Penguiconverter wiki, and the edit showed up on my Penguin Ice Wikis wiki. What can I do to make pages and edits separate on each wiki when they are pointed at a single place?

EDIT: I also added the database for Penguiconverter, and I got the following message: (Cannot access the database: Access denied for user 'gjlxrtap_penguinicewiki'@'localhost' (using password: YES) (localhost))

Newman2 (talkcontribs)

Has anyone seen the post above?

Reply to "Parse error: Unexpected "$wikiId" in Localsettings.php"

Upgrade from 1.27.4 to 1.31.0 fails during database update

4
Summary by Lady G2016

A database permissions problem reported by the database schema update script (/maintenance update.php) was misleading.

The problem was tracked to an incompatible LocalSettings.php file.

Debugging technique - Use your existing database, but with a LocalSettings.php file created from a clean install (should always work). Then, modify the "clean" configuration to match your installation.

Lady G2016 (talkcontribs)

Current: MediaWiki 1.27.4 Upgrade to: MediaWiki 1.31.0

PHP 7.1.17 (fpm-fcgi) MariaDB 10.2.14 URL - localhost (test environment)

Running the maintenance script update.php produces a privilege error:

=

Turning off Content Handler DB fields for this part of upgrade. Adding ipb_id field to table ipblocks ...[06a6bcb5ba7a28f0640c1c8d] [no req] Wikimedia\Rdbms\DBQueryError from line 1457 of /var/www/html/w/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: ALTER TABLE `mediawiki`.`ipblocks`

ADD ipb_auto tinyint NOT NULL default '0',
ADD ipb_id int NOT NULL auto_increment,
ADD PRIMARY KEY (ipb_id)

Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/html/w/maintenance/archives/patch-ipblocks.sql ) Error: 1142 ALTER command denied to user 'wiki'@'localhost' for table 'ipblocks' (localhost)

Backtrace:

  1. 0 /var/www/html/w/includes/libs/rdbms/database/Database.php(1427): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
  2. 1 /var/www/html/w/includes/libs/rdbms/database/Database.php(1200): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  3. 2 /var/www/html/w/includes/libs/rdbms/database/Database.php(4194): Wikimedia\Rdbms\Database->query(string, string)
  4. 3 /var/www/html/w/includes/libs/rdbms/database/Database.php(4129): Wikimedia\Rdbms\Database->sourceStream(resource (closed), NULL, NULL, string, NULL)
  5. 4 /var/www/html/w/includes/installer/DatabaseUpdater.php(683): Wikimedia\Rdbms\Database->sourceFile(string)
  6. 5 /var/www/html/w/includes/installer/DatabaseUpdater.php(751): DatabaseUpdater->applyPatch(string, boolean, string)
  7. 6 /var/www/html/w/includes/installer/DatabaseUpdater.php(482): DatabaseUpdater->addField(string, string, string)
  8. 7 /var/www/html/w/includes/installer/DatabaseUpdater.php(446): DatabaseUpdater->runUpdates(array, boolean)
  9. 8 /var/www/html/w/maintenance/update.php(200): DatabaseUpdater->doUpdates(array)
  10. 9 /var/www/html/w/maintenance/doMaintenance.php(94): UpdateMediaWiki->execute()
  11. 10 /var/www/html/w/maintenance/update.php(245): require_once(string)
  12. 11 {main}
==

Running the update script as a database user with administrator privileges produces this error:

Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/html/w/maintenance/archives/patch-ipblocks.sql ) Error: 1146 Table 'mediawiki.ipblocks' doesn't exist (localhost)

(same backtrace)

==

My database user account has "GRANT ALL PRIVILEGES ON `wiki`.* TO 'wiki'@'localhost'".

There are no errors when I run the update script from a version 1.31 clean install.

There are no errors when I run the update script from my current version 1.27.4.

I am blocked upgrading to version 1.31.0.

How can I debug this problem? I do not see any mention of this problem in Phabricator.

2001:16B8:106B:1200:B5FB:6E29:5A6F:ED48 (talkcontribs)

This is a problem with MySQL/MariaDB permissions. You are speaking about two different databases!

> ALTER TABLE `mediawiki`.`ipblocks`

> ALTER command denied to user 'wiki'@'localhost' for table 'ipblocks'

> GRANT ALL PRIVILEGES ON `wiki`.* TO 'wiki'@'localhost'

The correct database name obviously is "mediawiki", not "wiki".

Lady G2016 (talkcontribs)

Thank you for the reply. I agree, the database name does not match. There is no mention of 'mediawiki' in my LocalSettings.php file; the correct database name is 'wiki'. Therefore, the database name has changed during the script execution.

I was incorrect in my earlier statement of There are no errors when I run the update script from a version 1.31 clean install. The script did indeed run, but that was for a clean (new) database. The conditions which triggered my error did not occur - modification of an existing database.

All maintenance scripts utilize the configurations in LocalSettings.php. Perhaps this is the source of my problem? I replaced my existing LocalSettings.php file with the version created from a clean install. It worked!

I then modified the "clean" LocalSettings.php to align with my existing configuration. Extensions were added to the bottom of the file. (Previously, they were near the top of the file.) I don't know if the extension placement or a configuration setting was source of my problem.

In any case, I have a working configuration and can proceed with my testing.

Albert Ke (talkcontribs)

I had exactly the same error message as @Lady_G2016 indicated when upgrading from MW1.30 to MW1.31. So I asked for help from my University of Colorado colleague at the IT department, Karen. Karen indicated the following:

It almost looks like there is a code error. In most cases, the settings use $wgDBname, which properly points to the mysql database "csdms_wiki" [the dbname of my wiki].   However, in Setup.php, there is a reference to $wgDBmwschema, which, per LocalSettings.php should only be used if you are using postgresql. In LocalSettings.php, $wgDBmwschema points to 'mediawiki'. So maybe try changing the value for $wgDBmwschema in LocalSettings.php from 'mediawiki' to 'csdms_wiki'?

I did that and the update.php script runs smoothly. So could it be that the reference in the Setup.php to $wgDBmwschema shouldn't be there when running the wiki from a mysql database?

Thanks,

Albert.

Reply to "Upgrade from 1.27.4 to 1.31.0 fails during database update"
Hanstiser (talkcontribs)

Given that disabling the API is deprecated and is going to be removed in a future release, what methods are available for preventing unauthorized scraping of our copyrighted content? A lot of the unauthorized scrapers are coming in via the API and clone entire websites for their spam farm or unauthorized "backup" operations.

Short of firewalling off /api.php and DMCAing infringements, is there an easier way?

2001:16B8:10A6:ED00:BDCF:7E0F:E372:9C20 (talkcontribs)

Allowing, not preventing access is one of the main goals MediaWiki is written for. There surely are some crutches, which more or less well try hiding content inside MediaWiki, but the "correct" answer to your question is this:

If you do not want your content to be publicly available, do not use MediaWiki, at least not at a place, which is publicly accessible.

Johnywhy (talkcontribs)

i disagree. MediaWiki is a software platform, to be used however people want. That's what open source means. Once the software is in the wild, people can and should apply it to their own purposes.

For example, some companies use MediaWiki as an internal knowledge-base, for employees only.

There are a variety of extensions available providing various kinds of privacy or information-hiding.

MediaWiki core includes some information hiding, for example certain admin pages are not accessible to non-admins.

AhmadF.Cheema (talkcontribs)

What was probably, only meant was that MediaWiki, by default, is not designed for access control. Most, if not all, access control extensions here, have some drawbacks.

If content privacy is really important, then either not use MediaWiki or use a much more customized version of it (which might not even exist yet). Enterprise MediaWiki solutions (such as BlueSpice Pro) probably include some robust access control options.

2001:16B8:10A4:2700:88F4:955F:8894:E7B9 (talkcontribs)

That is true. As I said, using MediaWiki at a public place <b>will</b> make the content within the installation public. Sure, using MediaWiki inside an internal network is possible - after all it is not publicly accessible then.

137.147.0.130 (talkcontribs)

If your content is publicly accessible, it can easily be copied, there's no way to prevent this. What you want is fundamentally incompatible with the public web. The API doesn't even really make it easier, as they would then need a functional MW install configured with the same extensions and templates in order to reuse your content, whereas just HTML scraping will mostly work as is on any server.

Johnywhy (talkcontribs)

easier doesn't seem to matter to them, If the OP is correct.

Johnywhy (talkcontribs)
Reply to "How to prevent unauthorized scraping?"
Johnywhy (talkcontribs)

This method is said to no longer work since 1.29.

This page explains how to set the initial state of a custom element. But the TOC is part of core, not custom.

This works, but wondering if there's a recommended way to set initial collapsed state

#toc > ul{display:none;}

Ideally, i want the TOC to remember the user's preference. CSS would break that.

Reply to "TOC Collapsed Initial State?"

Is SemanticWiki the only way to get Topic Tagging?

12
Summary by Johnywhy

I've built a topic-tagging system, for inline tags, with some nice features like anchors, descriptions, tag-list, and highlighting. Extension:TopicTags

You can view a demo here.

That system is based on the following similar, but simpler way to achieve topic tagging, without the extra features.

  1. Create a namespace called Tag in localsettings.php
  2. Create page Tag:banana containing:
    <includeonly>[[Tag:banana]]</includeonly> {{Special:WhatLinksHere/Tag:banana|hideredirs=1|hidetrans=1}}
    
  3. Create several pages containing the following, anyplace on the page {{Tag:banana}}
  4. In any page, click the "Tag:banana" link, to view a listing of all pages tagged with "banana".


- The "includeonly" tags ensure the "Tag:banana" text will not appear on the page Tag:banana (that would be redundant, since the page name is already displayed as "Tag:banana")

- Although the tagged page contains a transclude, we're setting WhatLinksHere to show linked-pages-only, and hide transclusions. The reason the pages are pulled into the list as linked, is because the transcluded text itself contains the link [[Tag:banana]]. That link will appear on each tagged page.


  • Optional: to list all pages tagged with "banana" at the bottom of every page tagged with "banana", remove the "includeonly" tags from page Tag:banana. If you do this, tagged pages may take some time to refresh (or you can purge to see list immediately)
  • Optional: "(← links | edit)" can be suppressed by placing the following in Common.css or User:Username/skinname.css
.mw-whatlinkshere-tools{
    display:none;
}
<includeonly>[[Tag:banana]]</includeonly> {{#dpl: linksto=Tag:banana}}
      • Advantages:
        • when transcluded to tagged pages, the list of tagged pages will exclude the current page.
        • simpler syntax.
        • no extraneous text, that needs to be suppressed with CSS.
      • avoid tabular and possibly other special formatting. Topic:Uc62obhpez7r3zgh
Johnywhy (talkcontribs)

We want to tag our articles (topic-tags, not revision-tags).

And then display "Related Articles", based on those tags.

This article describes a method using SemanticWiki,

https://clkoerner.com/2012/08/28/use-semantic-mediawiki-semantic-forms-to-create-a-folksonomy-for-tagging-related-pages/

but that seems a heavy solution, since we don't need any other SemanticWiki features.

Any simpler or, preferably, native method?

Can't use Categories, as we're already using Categories as Categories, for organizing and TOC.

Thx

Ciencia Al Poder (talkcontribs)

Categories is the way to go if you don't want SMW. This is exactly the purpose of categories, group similar pages.

Johnywhy (talkcontribs)

We consider Categories and Tags to be different concepts. That Folksonomy article agrees.

Eg:

  • Category is Fruit.
  • Title is Oranges.
  • Tags are citrus, segmented, juicy, vitamin C, cold prevention, breakfast

Or

  • Category: Books
  • Title: Cien Años de Soledad
  • Tags: Spanish, surrealism, Colombia, magical realism, Latin American

We use Category as a hierarchical organizing structure. We want articles to appear in only one Category in TOC, but articles can have multiple tags. Tags are non-hierarchical, and can apply across different Categories. We really want tags independent of Categories.

Bawolff (talkcontribs)

Then create a prefix to the category name, to distinguish between your "real" categories and "tags". E.g. have "Category:Tag:Spanish"

The differences you cite between tags and categories is all in how you use the feature, and none in how the feature is actually implemented. If it makes you feel better, you can even do $wgExtraNamespaces[NS_CATEGORY] = 'Tag'; $wgExtraNamespaces[NS_CATEGORY_TALK] = "Tag_talk"; and then change the pages MediaWiki:nstab-category , MediaWiki:categories, MediaWiki:pagecategories, etc to use the word "Tag".

Johnywhy (talkcontribs)
> "create a prefix to the category name", E.g. have "Category:Tag:Spanish"

Thx, but that seems like a complicated, non-intuitive workaround.

Tree: This will put all the tags into the CategoryTree. We don't want the tags in the CategoryTree.

Entry: We want to apply Tags by simply entering "Spanish" in a "Tags" box. Don't want to enter "Category:Tag:Spanish".

Cross-Reference: We want a given tag to apply to multiple Categories. Then show "Related pages" based on Tags. I don't see how to do that with this method.

Subcategories: Maybe there's a way to do this with sub-categories.

Pro: Tree: CategoryTree has "depth" parameter, which would hide that subcategory "tags" which is good.

Con: No, subcategories would be difficult, if we want to allow same tag for multiple categories. That would require adding same subcategory to multiiple categories.

Con: I don't see how to cross-reference subcategories across different categories (to show "Related Pages" at bottom of every page, based on subcategory).

> "do $wgExtraNamespaces[NS_CATEGORY] = 'Tag'; $wgExtraNamespaces[NS_CATEGORY_TALK] = "Tag_talk"; and then change the pages MediaWiki:nstab-category , MediaWiki:categories, MediaWiki:pagecategories, etc to use the word "Tag".

That throws out Categories, and uses the word "Tag" instead of "Category". Correct? We don't want to throw out the word Category. We want both tags and categories.

Extension:RelatedArticles might help.

thx

Bawolff (talkcontribs)

Your description still sounds like you basically just want the category system

  • tree: just make sure the tags dont have the same parent as your "real" categories
  • entry: just make a page named Template:Tag containing <includeonly>[[category:Tag:{{{1}}}]]</includeonly>. Then you can simply add pages to tags by doing {{tag|Spanish}}
  • cross-reference: if you mean you want to add a category to a tag to imply that all members in that category should also be in that tag (for the purposes of Special:Recentchangeslinked) thats a little harder. There are some work arounds with extensions that do "deep category intersection". Some people also work around it by using templates to add things to categories that automatically specify the right additional tags, but there really arent great solutions to this. Basically for this method "real categories" and "tags" are entirely separate, and if you want all pages in a specific category to have a specific tag you have to tag them all individually.

Re subcategory - Im kind of confused by this-if you were tagging a category, it would be the parent of the category, not the child (subcategory). CategoryTree would ignore it as it doesnt look at backedges i the category graph.

Re tags namespace: yeah, thats just renaming category to tag.

Johnywhy (talkcontribs)

I tried your suggestion, but without involving Categories.

  1. Create a namespace called Tag in localsettings.php
  2. Create page Template:Tag containing:
    {{Special:WhatLinksHere/Tag:{{PAGENAME}}|hideredirs=1|hidetrans=1}}
    
  3. Create page Tag:Banana, containing {{Tag}}
  4. Create several pages containing [[Tag:Banana]]
  5. In any page, click the Tag:Banana link, to get a page listing all pages with that tag.

- What's the advantage of your method, involving categories, over this method? Seems to me that, since Tag, like Category, is a namespace, doing Tag:Banana is no different than doing Category:Tag:Banana, except less typing.

- "Cross-reference", meaning: transclude the full list of pages with same tag at bottom of each of them. If i can solve

-> this other issue <-, then i'll have that.

Bawolff (talkcontribs)

The only advantage with category pages, is you can distinguish between linking to a page vs including a page. Some people also find the lists of things in categories to be prettier, but if Special:Whatlinkshere works for you, that's great. :)

For cross-reference, you may want to look at the DynamicPageList extension.

Johnywhy (talkcontribs)

"with category pages, is you can distinguish between linking to a page vs including a page"

How?

Bawolff (talkcontribs)

If you type [[Category:Foo|What to sort page under]] it just puts the page in the category.

If you type [[:Category:Foo|Text to show for link here]] it will link to the category page, but not include the current page in the category (The current page will be on Special:Whatlinkshere for the category though)

Johnywhy (talkcontribs)
Johnywhy (talkcontribs)

I've built a topic-tagging system, for inline tags, with some nice features like anchors, descriptions, tag-list, and highlighting. Extension:TopicTags

You can view a demo here.

Johnywhy (talkcontribs)

The following CSS has no effect:

.mw-headline{
    margin-top: 30px;
}

however, this does have effect:

.mw-headline{
    margin-left: 100px;
}

Same problem with padding.

How can i add margin or padding above headings?

AhmadF.Cheema (talkcontribs)

Apparently, the ".mw-headline" .CSS rule gets overridden by the more defined ".mw-headline h2" rule for "margin-top", already present in the skin.

You will have to use something like:

.mw-headline h2, .mw-headline h3 {
    margin-top: 30px;
}
Johnywhy (talkcontribs)

you mean ".mw-headline h2" in the skin, and ".mw-headline h3" , ".mw-headline h4" , etc?

AhmadF.Cheema (talkcontribs)

I think so (I'm not exactly sure what you meant there).

In .CSS rules with higher specificity (i.e. ".mw-headline h2") overrides rules with lower specificity (i.e. just ".mw-headline"). As in this particular case higher specificity rules are already defined in the skin, you will need to add a rule with greater or equal specificity in your MediaWiki:Common.css.

Johnywhy (talkcontribs)

So far only this works:

h2>span{
    padding-top: 30px;
}

But would be preferable if i could use the classname somewhere in that.

AhmadF.Cheema (talkcontribs)

Apologies, hadn't actually tested the rule.

Another way to make this work, would be the following:

#mw-content-text > div > h2,
#mw-content-text > div > h3, 
#mw-content-text > div > h4 {
    margin-top: 30px;
}
Johnywhy (talkcontribs)

so, going roundabout way through a different named element?

Should work, assuming the headings are the only element ever to fit that selector.

Reply to "Can't Style .mw-headline Top?"

MediaWiki: Extension URLs are returning "404 Not Found"

1
Esconfs (talkcontribs)

Hi there,

We are getting 404 for all MediaWIki: URL paths

/wiki//index.php/MediaWiki:Common.js

/wiki/index.php/MediaWiki:Common.css

also Imagery is having the same problem even though the Images do exist?

when clicking on the image within a Page we get the following 404s

e.g.

https://huddletalk.wpengine.com/wiki/index.php/File:Management_Patterns.jpeg

https://huddletalk.wpengine.com/wiki/index.php/File:Execution_Patterns.jpeg

ScreenShot of Common.js here:

http://prntscr.com/jwsml7

Any Advice on what we may need to do, would be greatly appreciated

Kind Regards

Reply to "MediaWiki: Extension URLs are returning "404 Not Found""