Last modified: 2010-05-15 15:56:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 5460 - Cannot run 1.6 "update.php" script from commandline
Cannot run 1.6 "update.php" script from commandline
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.6.x
All Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-05 12:04 UTC by Greg Hurrell
Modified: 2010-05-15 15:56 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Greg Hurrell 2006-04-05 12:04:04 UTC
I just checked out a clean copy of 1.6 via SVN using the following command:

svn co http://svn.wikimedia.org/svnroot/mediawiki/branches/REL1_6/phase3

I then copied across my LocalSettings.php file and moved the directory into place on the server.

No matter what I do, I am unable to run the update.php script from the command line. It always fails with some kind of error no matter which options I 
supply.

php -cli ./maintenance/update.php
(fails: tries to connect to database without a password as the user running the script)

sudo -u apache php -cli ./maintenance/update.php
(fails: claims safe mode restriction in effect and cannot write to counter.php)

sudo -u apache php -cli -d safe_mode=0 ./maintenance/update.php
(fails: tries to connect to database without a password as user running the script)

sudo php -cli -d safe_mode=0 ./maintenance/update.php
(fails: tries to connect to database without a password as root)

sudo php -d safe_mode=0 ./maintenance/update.php
(fails: tries to connect to database without a password as root)

chown -R apache:apache .
sudo -u apache php -cli ./maintenance/update.php
(fails: longer complains about unwriteable counter.php but still tries connecting without a password as the user running the script)

sudo -u apache php -cli -d safe_mode=0 -d open_basedir=/ ./maintenance/update.php
(fails: tries to connect as user running the script)

I tried that last one because it was complaining a about a safe mode restriction and not being able to access the file where I store my database username 
and password (which I've moved outside of the webroot for security reasons). When I add the "open_basedir=/" option it evidently reads the file, but it 
ignores the settings inside and tries to connect as the user running the script, not the user specified in the settings. I tried copying the database username 
and password into the LocalSettings.php file and it *still* tried connecting as the user running the script, so in all cases it is ignoring the settings in 
LocalSettings.php.

I don't know why it is complaining about safe mode when I run this stuff from the command line. I know of no reason why that restriction would be in 
effect. I doubt it has any effect on the command line, but safe mode is definitely turned off in my httpd.conf for my MediaWiki directory.

I don't really understand why it is so fiendishly difficult to upgrade. Sounds like a bug in the update procedure (possible) or a bug in the release/upgrade 
instructions.
Comment 1 Rob Church 2006-04-05 15:20:41 UTC
(In reply to comment #0)
> php -cli ./maintenance/update.php
> (fails: tries to connect to database without a password as the user running
the script)

1. Read http://www.mediawiki.org/wiki/Help:Upgrading_to_1.6
2. You need to set up an AdminSettings.php file in the wiki root
3. Run update.php *from within the maintenance dir* to be sure
Comment 2 Greg Hurrell 2006-04-05 17:41:01 UTC
Many thanks for providing the link, Rob. The missing AdminSettings.php file was the problem. My first attempt failed 
because my database user didn't have enough privileges to create/alter tables etc, so I temporarily escalated those 
privileges. But I did also discover a bug in the update.php script.

Running it from inside the maintenance directory (ie. with "php ./update.php") or from outside the maintenance directory 
(ie. with "php maintenance/update.php") I got this error both times:

Making wl_notificationtimestamp nullable... <br />
<b>Warning</b>:  fopen(maintenance/archives/patch-watchlist-null.sql): failed to open stream: No such file or directory 
in <b>/home/greghurrell.net/public_html/salsawiki/includes/Database.php</b> on line <b>1671</b><br />
Could not open "".

In other words it was looking for a file at "maintenance/archives/patch-watchlist-null.sql" *inside* the maintenance 
directory (ie. at "maintenance/maintenance/archives/patch-watchlist-null.sql"). As a quick work around, I made those 
subdirectories and copied in the missing file, and the update.php script then worked.
Comment 3 Rob Church 2006-04-05 18:03:29 UTC
(In reply to comment #2)
> Running it from inside the maintenance directory (ie. with "php ./update.php")
or from outside the maintenance directory 
> (ie. with "php maintenance/update.php") I got this error both times:
> 
> Making wl_notificationtimestamp nullable... <br />
> <b>Warning</b>:  fopen(maintenance/archives/patch-watchlist-null.sql): failed
to open stream: No such file or directory 
> in <b>/home/greghurrell.net/public_html/salsawiki/includes/Database.php</b> on
line <b>1671</b><br />
> Could not open "".

That's a known bug which I am, this second, committing the fix for. I'm going to
mark this resolved now, too.
Comment 4 Greg Hurrell 2006-04-05 18:20:56 UTC
Good work.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links