Topic on Project:Support desk

188.104.9.130 (talkcontribs)

Hello,

I tried to make an upgrade as described under Manual:Upgrading. I created a new directory, installed all the new files, copied LocalSettings.php and images, then started the update.php script. I get the following message:

syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/vhosts/web468.webbox180.server-home.org/html/phys-med.de/wiki/maintenance/update.php on line 137

Can anyone help me what that means and how I can fix it?

Thank you!

Daniel

AhmadF.Cheema (talkcontribs)

Can you confirm that you copied the files for MediaWiki v1.32 into an empty directory?

Also, what's the PHP version for your setup?

188.104.9.130 (talkcontribs)

Yes, i can confirm that. I extracted the files to a new directory and copied only LocalSettings.php and the images-directory from the old installation.

PHP Version is 7.3.2, but I can change that if necessary.

AhmadF.Cheema (talkcontribs)
Want (talkcontribs)

Before two weeks I upgraded two wikis where I am admin. First my private wiki from (1.29 to 1.34-alpha) and second was wiki for our department (from 1.26 to 1.31 LTS). Both servers use PHP 7.3, and no problem.

But to theme – I'd rather upgrade gradually. First from 1.17 to 1.19 (old LTS). After to 1.23 (old LTS), next 1.27 (old LTS) after it do upgrade from PHP 5.6 to 7.3 and finally upgrade MediaWiki to 1.31 (latest LTS). See Version_lifecycle

Big step from 1.17 to 1.32 is very risically acording me.

Grmblfx5 (talkcontribs)

Thank you fpr the hint!


I changed PHP version now to 7.0.33, but still get the same error message:

"PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/vhosts/web468.webbox180.server-home.org/html/phys-med.de/wiki/maintenance/update.php on line 137"


Any futher ideas what's wrong?

AhmadF.Cheema (talkcontribs)

Sometimes multiple PHP versions are available on the same system.

Can you make sure that the PHP version used to install MediaWiki is the correct 7.0 one?

Grmblfx5 (talkcontribs)

Yes, my hoster offers the following versions:

5.6.40

7.0.33

7.1.26

7.2.15

7.3.2


The first one is too old, the last one too new, so I took the 7.0.33, which should work.

What do you mean by "correct one"? I copied the new mediaWiki files to my server and tried tu run the update script, which gives me the above error message.

AhmadF.Cheema (talkcontribs)

Try running php -version before running the update script and see what version the system gives you.

94.218.62.136 (talkcontribs)

Thanks for the tip!

On the bash, I get php version 5.4.16.

Running phpinfo in the web browser, I get 7.0.33

I tried to run the update script via web browser as described in Manual:Upgrading#Web browser

The first step /mw-config/ works, but then I get a blank page

Any ideas how to go on?

AhmadF.Cheema (talkcontribs)

Can't you ask your hoster how to access PHP 7.0 through bash. Sometimes a different command is used to access the different PHP version, for example, php54 to access PHP 5.4.

You can try running php70 -version if PHP 7.0 is available though this command, otherwise ask your hoster.

Jonathan3 (talkcontribs)

Yes, for example, for PHP 7 I have to type /usr/local/bin/php70-cli instead of just php.

92.74.45.37 (talkcontribs)

Thank you, Jonathan3, that was the solution! I have to type the full path to the PHP-Version I wish.

Now the update is ready, only problem is to find a replacement for the great NiceCategoryList2 I used under the old version...

AhmadF.Cheema (talkcontribs)
Grmblfx5 (talkcontribs)

Thanks for the hint!

I tried both but was only able to show categories, not pages.

With NCL2, I could produce a complete index of contents as starting page, as shown here:

http://www.psych-med.de/wiki/index.php?title=Hauptseite


Is that possible with an other, newer extension?

AhmadF.Cheema (talkcontribs)

The example is a little difficult to understand. From what I follow, you want the pages categorized inside a specific category to be listed.

If so, through Extension:DynamicPageList3, the following should show the first 10 pages from your Category:Begriffe.

<DynamicPageList>
category             = Begriffe
count                = 10
order                = ascending
</DynamicPageList>
Grmblfx5 (talkcontribs)

Thanks for your help, bu that doesn't do what I want. 8a recursive list of categories and pages in that categories).


But it hasn't to do with my original topic, so I will try to find information on the project page or start a new topic here!


Thank you!