Topic on Project:Support desk

[RESOLVED] Maintenance script and metadata.ini

6
Tanonero (talkcontribs)

Hello, this is me again, I am writing because I am still struggling with running maintenance scripts. I am working on MediaWiki 1.24.2, PhP 5.3.8, and MySqQL 5.5.21. After having been assaulted by SPAM in the past days, I am trying to clear a huge list of bots by using deleteArchivedRevisions and removeUnusedAccounts. I've been trying to do this both from web broswer (with the extensions Maintenance) and from terminal. However, in the former I can just get a list of revisions and accounts to be removed and I can't activate the --delete function (I guess it's normal this way), in the latter I get the mysterious:

parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'} in /home/etc etc/maintenance/removeUnusedAccounts.php on line 34

I don't have a clue on what it is actually expecting as I don't believe that I should modify that file in the maintenance. Can anybody suggest anything?

Tanonero (talkcontribs)

I believe that I can overcome this problem by adding the related option to the metadata.ini in the Maintenance folder. However, I am trying different combinations but I can't get it done. Does somebody know how to add the parameter --delete of deleteArchivedRevisions.php to

[deleteArchivedRevisions]
enabled = 1

and the parameter --delete of removeUnusedAccounts.php to

[removeUnusedAccounts]
enabled = 1

?

88.130.101.238 (talkcontribs)

First, I would not try to run this strange extension, which almost certainly is a security risk. But I would try making the shell work correctly.

PHP versions used by Apache and on the shell can be different - and often are. Which PHP version do you have on the shell? You can check that by just calling PHP with the parameter -v and nothing else. I guess you are currently using an old version on the shell, which is the reason for this error you got.

Tanonero (talkcontribs)

Yes, you're right, by executing

php -v

I get 4.3.4 as PhP version, whereas the PhP of my server is 5.3.8. Is there anything I can to do upgrade that version so as to execute the scripts correctly?

88.130.122.168 (talkcontribs)

Newer versions of PHP can be available under another name, e.g. as php53, php55, php56 or so. If they are and if so under which name, is determined by the setup of the server. Your host will know that!

Tanonero (talkcontribs)

Yes, the web team allowed me a shell access to a different system and I managed to run the scripts! Deleting 15,100 bots at once was amazing. Thank you very much for your help. I am marking this discussion as RESOLVED.

Reply to "[RESOLVED] Maintenance script and metadata.ini"