Last modified: 2010-05-15 16:03:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T19611, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17611 - lighttpd + sqlite installation failure
lighttpd + sqlite installation failure
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.13.x
All Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: sqlite 18629
  Show dependency treegraph
 
Reported: 2009-02-22 03:41 UTC by Vijay Avarachen
Modified: 2010-05-15 16:03 UTC (History)
3 users (show)

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


Attachments
Fix applied to line 25 (11.16 KB, patch)
2009-02-22 03:41 UTC, Vijay Avarachen
Details

Description Vijay Avarachen 2009-02-22 03:41:41 UTC
Created attachment 5845 [details]
Fix applied to line 25

sqlite-3.3.6-2
php-5.1.6-20.el5_2.1
lighttpd-1.4.20-1.el5.rf
mediawiki-1.13.4

When attempting to install mediawiki using sqlite as the backend, I get the following errors.

Warning: mkdir() [function.mkdir]: Permission denied in /repos/mediawiki/includes/db/DatabaseSqlite.php on line 26
# Attempting to connect to database "wikidb" as "wikiuser"...
Warning: mkdir() [function.mkdir]: Permission denied in /repos/mediawiki/includes/db/DatabaseSqlite.php on line 26

Fatal error: Call to undefined function wfPrintError() in /repos/mediawiki/includes/Exception.php on line 283


Upon closer inspection, I noticed that line 25 contains the following:
if ("$wgSQLiteDataDir" == '') $wgSQLiteDataDir = dirname($_SERVER['DOCUMENT_ROOT']).'/data';


dirname function call does not make sense here because $_SERVER['DOCUMENT_ROOT' is always a directory.  In my case it is "_ENV["DOCUMENT_ROOT"]	/repos" (from phpinfo() ). 

dirname function returns / and attempts to create the directory at //data.

Simple fix:
if ("$wgSQLiteDataDir" == '') $wgSQLiteDataDir = $_SERVER['DOCUMENT_ROOT'].'/data';

Cheers,
Vijay
Comment 1 Tim Starling 2009-05-05 14:29:03 UTC
I'm not sure how that would help. It still wouldn't be a directory, right? So you'd still get the same error.
Comment 2 Tim Starling 2009-05-08 05:55:46 UTC
If the autodetected data directory is wrong, you should enter one manually in the "SQLite data directory" box. I've committed a change in r50329 for release in 1.15 which hopefully makes this more clear.

Note that you should *not* use a directory which is in the document root, because if you do that, the whole database will be publically accessible, leaking private information such as user password hashes. The dirname() is there to put the data directory one level up from the document root, e.g. in /var/data when /var/www is the document root.

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


Navigation
Links