Topic on Project:Support desk

Trouble with Categories not Populating

13
IcarusATB (talkcontribs)

Versions:

MediaWiki1.31.1
PHP7.0.25 (cgi-fcgi)
MySQL5.6.41-84.1

Wiki located at: https://GreyhawkOnline.com/greyhawkwiki

So, the thing is that I imported a lot of pages (via Special:Import) and none of the pages are populating in Categories. It's only generally showing 0 - 2 pages in each category. So, after some reading, I found "rebuildall.php", which from what I understand will refresh the tables that denote the pages in all the categories.

So, the problem is that when I use Putty to navigate to a command line in my wiki directory, and I enter:

php maintenance/rebuildall.php

… it won't run the file. Instead, I get:

Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /path/to/wiki/greyhawkonline.com/greyhawkwiki/maintenance/rebuildall.php on line 47


Clearly, I am missing something here, and I need a little help figuring out what it is that I am missing here.

Or, if there's an easier way, using phpMyAdmin, or something, that'd be great!

Thanks, in advance for your help.

HSRobinson (talkcontribs)

Try


cd maintenance

php rebuildall.php


That may help.

IcarusATB (talkcontribs)

Also, of note … down the thread, I mentioned that your later help solved my problem.

But, it's interesting that I did have to use "change directories" as you mention here, after all.

I don't know why it wouldn't accept the command from one folder up, but, it made a difference!

IcarusATB (talkcontribs)

@HSRobinson … thank you for the tip.

Unfortunately, I did already try that, but, also just tried it again, to make sure that running it from that particular directory made a difference. I got the same result, asking for a variable in line47, for whatever it's worth.

Thank you, though.

AhmadF.Cheema (talkcontribs)

Did you recently upgrade MediaWiki?

IcarusATB (talkcontribs)

@AhmadF.Cheema … nope, this is an installation that is scarcely two weeks old. First time installation.

IcarusATB (talkcontribs)

For sake of saying … in the MediaWiki installation, the line that is being questioned when I try to run it (Line47) is in this section:

42       public function execute() {
43          // Rebuild the text index
44          if ( $this->getDB( DB_REPLICA )->getType() != 'postgres' ) {
45               $this->output( "** Rebuilding fulltext search index (if you abort "
46                   . "this will break searching; run this script again to fix):\n" );
47          $rebuildText = $this->runChild( RebuildTextIndex::class, 'rebuildtextindex.php' );
48          $rebuildText->execute();
49        }
2001:16B8:1040:AA00:343F:8B13:F674:9870 (talkcontribs)

The CLI version of PHP does not necessarily have to be the same version as the one the webserver uses.

Please run php --version on the command line and tell us the PHP version you have there. My guess is that the CLI version of PHP, which you are using, is too old.

IcarusATB (talkcontribs)

SO, from the command line, the php --version responds with:

PHP 5.4.45 (cli) (built: Apr 17 2017 15:59:08)

That seems strange that above, I listed it as 7.0.25, because that's what the wiki responded with.  So, I'm not sure how or why this differs from the Command Line response.  So, that, at least, makes sense … if there's outdated software and the new version of  rebuildall.php then, obviously, it's not going to respond properly if it's calling for something that's not even there in the old php, I guess?

So, since my my MediaWiki software is written for a newer version of PHP, and requires 7.0 …  how … I … what th-?

Where is the 5.4.45 version I have running from, then, and how do I fix that so that the rebuildall.php can run?

HSRobinson (talkcontribs)
IcarusATB (talkcontribs)

OMG, OMG , OMG!!! THIS IS SO IT!!! @HSRobinson this was difficult, no doubt! I had to really try hard to figure out what the article (and the answer to the question) was really telling me to do. It wasn't immediately clear that I was altering the code within a file, and that I had to type in the altered code, and save it.

That seems simple, I know, but, once I "got it", the CLI immediately responded that I was now running PHP7.1!!!

And then, once followed the directions of the Help:rebuildall page, the CLI immediately began running the Rebuild!!

It's doing it all RIGHT NOW AS WE SPEAK!!

Thank you, thankyou, thankyou!

I can't thank you enough. I appreciate the help, SO MUCH!!

2001:16B8:10C8:4800:F9B9:FDD5:FA16:F61D (talkcontribs)

You need to do one of two things now: Either find out the command, with which you can run a newer version of PHP on the CLI. That might e.g. be php70 (does php70 --version work?) or something like that.

If however, a newer CLI version of PHP is not currently installed on the server, then it first needs to be installed and then you can use it.

Bawolff (talkcontribs)

Note, categories not updating may be indicative of a problem with the Job queue (which may be a separate issue from your issue running rebuildAll.php)