Author: vavarachen
Description:
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
Version: 1.13.x
Severity: normal
OS: Linux
Attached: