Manual talk:Maintenance scripts

From MediaWiki.org
Jump to: navigation, search

Contents

[edit] Executing the maintenance scripts

What is meant by "filling in the required connection instructions"? Do I have to write these instructions into the "AdminSettings.php"? Sorry for asking such stupid questions. My best, --84.75.55.96 22:30, 6 November 2007 (UTC)

In the AdminSettings.sample, the connection information is generic. You will notice that :
$wgDBadminuser = 'wikiadmin';
$wgDBadminpassword = 'adminpass';
You should simply replace the values of 'wikiadmin' and 'adminpass' with your own database username and password in your AdminSettings.php file.
Stéphane Thibault 05:20, 27 December 2007 (UTC)
Ok, thanks! I did that. But how do I establish a commandline connection with the database server? I am working on a Mac and our wiki is installed on server of a hosting provider. But I think I have Shell access; at least it says shell access via "/bin/false". But I really have no clue how to connect. Do I need a particular program for that? My best, --Gollum 19:54, 26 February 2008 (UTC)
If the shell of a user is set to "/bin/false" it is usually the technical way of saying "no shell access". A shell is a program that reads your commands and executes them, while /bin/false only does one thing: exits immediately. --Myhr 13:14, 27 February 2008 (UTC)
Oh, that does not sound too good. What can I do then? Is there another way to execute the maintenance scripts then? Is it normal to ask the provider to do so? Any other ideas? My best, --Gollum 21:35, 27 February 2008 (UTC)
I have the same problem. I do not have access to SSH. I set up a cron job like this one:
*/45 * * * * /usr/local/bin/php /home/httpd/public_html/wiki/maintenance/generateSitemap.php wiki.mydomain.com --fspath /home/httpd/public_html/wiki/
Is that ok? (sorry for my poor english). --89.217.47.34 02:23, 1 April 2008 (UTC)

[edit] How to run maintenance scripts from a Web client?

Some users I'm helping are on hosted sites and aren't able to ssh in to run command-line scripts. It would be nice if there was some guideline and/or an alternative commandLine_ALLOW_FROM_WEB.inc that permits these users to run maintenance scripts from a Web page.

Renaming .htaccess to .htaccess_DISABLED lets one view the directory, but I think the next step is disabling the Web server check in commandLine.inc and replacing its command-line parsing with query string parsing. -- Skierpage 01:34, 24 October 2007 (UTC)

[edit] How do I purge the cache fo all my hundreds of image pages?

I need to purge the cache for all my "image:" pages. (all at once) Is there a maintenance script to do this? purgeList.php? How does it work? or some other script? puzzled and in need --Maxelrod 22:16, 20 March 2008 (UTC)

[edit] importTextFile.php

I can't figure out how to get this file to work! I have tried through many ways including the sourceforge project wiki_import. When I use the importTextFile.php directly I get this error:

 Warning:  fwrite(): supplied argument is not a valid stream resource in /opt/lampp/htdocs/test/en/includes/Exception.php on line 128


I'm calling importTextFile.php using this code:

 php-cgi /path/to/importTextFile.php --title="filename.txt" --user=auto_import "/path/to/file.txt" --fspath "/path/to/wiki/"



I'm calling the wiki_import.sh using this code:

 echo "/path/to/file.txt" | wiki_import.sh -s 'Title'


and I get this error:

 DB connection error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (localhost)

--Greg 22:01, 12 April 2008 (UTC)

[edit] Extension:Maintenance

For those without command line access, I wrote an extension that runs a few of the scripts from a special page, but I'm not really all that sure how I should add a mention of it on the manual page. At first I was thinking about a simple see also link, but it should probably be outlined somewhere that there is an alternative (albeit not a very good one in terms of number of scripts it supports) for those without command line access. So... I don't know where to put a message like that :P --Skizzerz 23:19, 23 May 2008 (UTC)

[edit] Extension:MaintenanceShell

I expanded on Skizzerz ideas and made an extension which supports all maintenance scripts :) --Frantik 02:05, 31 May 2009 (UTC)

[edit] many scripts still not described

Is there anyone able to add some documentation about the scripts listed here with no corresponding page ? --New Morning 09:41, 2 July 2008 (UTC)

[edit] 1&1

Hi,

When I try to run these scripts with putty, it answers : this version of Mediawiki requires php5 ; you are running 4.4.9. But I have already configured my htaccess with AddType x-mapp-php5 .php that is required on 1&1. I don't understand.

.htaccess only affects scripts run from the web server. When you use putty you're using the command line so htaccess isn't being used. I'm not quite sure how to run php5 via the command line in 1&1.. maybe try "php5" instead of "php"? --Frantik 02:14, 31 May 2009 (UTC)

[edit] AdminSettings.php

Which scripts require this? I haven't renamed it and most of them seem to work.. or do i get improved security if I do set it up correctly? --Frantik 02:11, 31 May 2009 (UTC)

[edit] Godaddy php5 not installed

Took me a while to get this, so I'm gonna share it with all those running Mediawiki in Godaddy.

When using Putty to run maintenance scripts, you'll get a message about not having php5 installed even though you have PHP5 installed. This is because Godaddy defaults to PHP4. To run maintenance scripts, instead of writing, let's say:

php cleanupTitles.php

write...

web/cgi-bin/php5 "cleanupTitles.php"

This way you load php5 instead of the default php4. --Mark 08:23, 8 December 2009 (UTC)

[edit] 404 error

I am following the instructions (and added screenshots) and logged into putty:

http://www.mediawiki.org/w/index.php?title=Manual:Maintenance_scripts&oldid=365943#Running_the_scripts

When I type:

php rebuildall.php

I get the error:

php rebuildall.php 
Status: 404 
Content-type: text/html

Mediawiki states that:

1. I need to make sure the path is correct, for example:

php /home/httpd/host/XXXXXXX.com/httpdocs/wikidirectory/maintenance/refreshLinks.php
or

2. "you have to run it from the server, not through a browser. Either through SSH..." [1] I have ssh access

Adamtheclown 18:36, 25 November 2010 (UTC)

[edit] 404 error solution

With the help of emufarmers I figured it out:

[Bobtheperv@p9nlh999 ~]$ ls
backup  cgi  crontab  data  dea1031109999999.sql  html  mydatabase.sql
[Bobtheperv@p9nlh999 ~]$ cd html
[Bobtheperv@p9nlh999 html]$ ls
[Bobtheperv@p9nlh999 html]$
[Bobtheperv@p9nlh999 html]$ cd dr
[Bobtheperv@p9nlh999 dr]$ cd maintenance
[Bobtheperv@p9nlh999 maintenance]$ php rebuildall.php
Content-type: text/html

Sorry! This version of MediaWiki requires PHP 5; you are running 4.4.9.

If you are sure you already have PHP 5 installed, it may be installed
in a different path from PHP 4. Check with your system administrator.
[Bobtheperv@p9nlh999 maintenance]$

Adamtheclown 01:42, 26 November 2010 (UTC)

[edit] namespaceDupes.php conflicts

i'm trying to do some reorganization of our namespaces, [including removing some] and unfortunately i've got a handful of pages that exist outside one the namespaces that were apparently put in before we created it.

i'm trying to run namespaceDupes.php to push pages formerly under a namespace into the main namespace, but it results in the following error:

Checking namespace 104: "Namespace"
... 2 conflicts detected:
... 2758 (0,"Namespace:FAQ") -> (104,"FAQ") Namespace:FAQ
...  *** cannot resolve automatically; page exists with ID 2769 ***
... 2567 (0,"Namespace:Replication") -> (104,"Replication") Namespace:Replication
...  *** cannot resolve automatically; page exists with ID 2759 ***

i found a number of pages via google that had this error but with no information as to how to go about resolving these conflicts.

Zeefreak 15:42, 10 October 2011 (UTC)

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox