Difference between revisions of "MediaWikiLite"

From Organic Design wiki
m
(Change source-code blocks to standard format)
 
(125 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The idea of MediaWikiLite is to allow the current MediaWiki codebase to run as a standalone server without requiring a database server or web-server. This forms the foundation for a number of alternative uses for the MediaWiki software in enviroments where the current LAMP architecture is too resource intensive.
+
{{legacy}}
*[[w:Personal wiki|Personal wiki]]: Personal desktop wiki's are becoming very popular, but they do not use the MediaWiki parser, and making a fork of the parser code defeats the purpose.
+
The idea of MediaWikiLite is to allow the current MediaWiki codebase to run as a standalone server without requiring a database server or web-server so that it can be used like a [http://stickwiki.sourceforge.net/ wiki on a stick]. This forms the foundation for a number of alternative uses for the MediaWiki software in environments where the current LAMP architecture is too resource intensive.
*Embedded devices such as PDA's, iPod's and iPhone's can only run lite applications effectively and getting MediaWiki onto them would be very useful, especially if it's designed to synchronise with a web-based mirror when an internet connection is available.
 
*[[PeerPedia]]: A lite version of MediaWiki is required to make it a possible candidate for a client side wiki interface to a P2P article space.
 
  
This extension creates a new database subclass which allows a MediaWiki to work from an [http://www.sqlite.org SQLite] database instead of MySQL. MySQL is good for large centralised sites serving many clients, but we'd like MediaWiki to be able to run on small local systems such as [[IPhone and iTouch|iPods or iPhones]]. MySQL is the main obstacle preventing us from creating a light-weight MediaWiki install which would also be a big step towards our [[Peerpedia]] idea.
+
There are a number of [[w:Personal wiki|personal desktop wiki]]'s out there, but they do not use the MediaWiki parser, and making a fork of the parser code defeats the purpose. Also, embedded devices such as PDA's, iPod's and iPhone's can only run lite applications effectively and getting MediaWiki onto them would be very useful, especially if it could synchronise with a web-based mirror when an internet connection becomes available.
  
== Replacing the Web Server ==
+
A lite version of MediaWiki would make a possible candidate for a client side wiki interface to a P2P article space, i.e. a decentralised Wikipedia or [[PeerPedia]].
This may require FastCGI or a similar alternative because there is problems with functions such as ''header()'' which have no effect when running from command line but the function still exists so it can't be replaced. Unless there's some way of overriding built-in functions, this may not be possible.
 
  
[http://nanoweb.si.kz NanoWeb] looks like a good solution for the this. It's a web-server entirely written in PHP and comes with a number of modules such as a ReWrite clone. It can execute CGI scripts using a normal CGI module or a FastCGI module. Also the modules looks very easy to write so a module specifically designed to maintain a MediaWiki instance in memory could be written.
+
As of version 1.13, MediaWiki natively supports the [http://www.sqlite.org SQLite] database which is a program library compiled in to PHP instead of running as a separate server outside of the PHP environment. A running instance of MediaWiki 1.15.1 using the SQLite database can be seen at [http://www.mediawikilite.org mediawikilite.org] to test the current functionality.
  
== SQLite Installation ==
+
To remove the need of an external web-server such as Apache or IIS, we're using [http://nanoweb.si.kz NanoWeb] which is a web-server entirely written entirely in PHP and comes with a number of modules such as a [http://nanoweb.si.kz/manual/mod_rewrite.html mod-rewrite] clone for friendly URL's. It can execute CGI scripts using a normal CGI module or a FastCGI module.
*To install SQLite on a Debian based system, use <tt>apt-get install php5-sqlite</tt>.
 
*Code base would need to be patched to allow SQLite to work for a wiki installation since extensions are added from LocalSettings.php
 
*Adding DatabaseSqlite.php to includes doesn't help because the includes need to be added to the autoloader list
 
*We really want SQLite3 but there's currently some problems installing it, will check it out with version 2.x first
 
  
== Development Notes ==
+
== Portable folder structure (still in testing) ==
I've created a local MediaWiki-1.11 codebase copy that I can modify without affecting other local wikia. The ''config/index.php'' MediaWiki install script needs to be hacked to add an SQLite option. I added the following to the end of the ''$ourdb'' array:
+
I've packaged PHP/SQLite, NanoWeb and MediaWiki together into a self-contained folder structure which can be downloaded from [http://www.organicdesign.co.nz/files/MediaWikiLite-2010-06.zip here] for testing purposes. The wiki is started by running the ''wiki.bat'' file in the base of this structure. Currently it only runs in Win32 environments, but soon the one structure will be able to be moved between Linux, OS X and Windows. The sysop user is '''WikiSysop''' with password '''admin'''. The database is in a file called '''wikidb.sqlite''' in the wikis '''images''' directory to be sure it's a writeable location and that it's bundled in with the uploaded file content of the wiki.
{{code|<php>
+
 
$ourdb['sqlite']['fullname']      = 'SQLite';
+
Here's a tree view showing the main items in the structure:
$ourdb['sqlite']['havedriver']    = 0;
+
{{#tree:root=MediaWikiLite|
$ourdb['sqlite']['compile']       = 'sqlite';
+
*php
$ourdb['sqlite']['bgcolor']      = '#ffe5a7';
+
**php.ini
$ourdb['sqlite']['rootuser']     = 'root';
+
*nanoweb
require_once("$IP/extensions/MediaWikiLite.php");
+
*mediawiki
</php>}}
+
**LocalSettings.php
Currently running through the install procedure fails when selecting SQLite because there's still more methods to fill out in the ''DatabaseSqlite'' class.
+
**extensions
 +
***DynamicPageList
 +
***TreeAndMenu
 +
***RecordAdmin
 +
**skins
 +
***OrganicDesign
 +
***Vector
 +
***MonoBook
 +
**images
 +
****wikidb.sqlite
 +
*sys
 +
**cwd.php
 +
**make-conf.bat
 +
**splash.html
 +
**SetSFN
 +
***SetSFN.exe
 +
*wiki.bat
 +
}}
 +
 
 +
The '''php''' directory is a standard PHP installation except for some changes in the ''extension'' section.
 +
 
 +
The '''nanoweb''' directory is the current NanoWeb condebase with no changes.
 +
 
 +
The '''mediawiki''' directory is a standard current MediaWiki code-base, except for ''LocalSettings.php'' and ''extensions''.
 +
 
 +
The '''sys''' directory contains various scripts required during wiki startup.
 +
 
 +
The '''wikidb.sqlite''' file is the entire wiki database containing all the articles and history (not the images though).
 +
 
 +
Use the '''wiki.bat''' file to start the wiki, soon this will work across platforms, but currently only works on Win32.
 +
 
 +
== Development notes ==
 +
=== Getting the portable structure to run under Linux based systems ===
 +
''in progress...''
 +
 
 +
=== Getting the portable structure to run under OS X ===
 +
''in progress...''
 +
 
 +
=== Getting the portable structure to run under Win32 ===
 +
I've successfully created a self-contained folder structure containing ''NanoWeb'' and ''PHP'' which is able to be run from the command line without any changes to the OS. My test folder structure was ''C:\MyWiki'' and required config files to be created for both applications which I placed into the root of each (''C:\MyWiki\nanoweb'' and ''C:\MyWiki\php''). In the case of ''php.ini'' the only change required was to enable some extensions as follows:
 +
<source>
 +
extension_dir = ./php/ext
 +
 
 +
    .
 +
    .
 +
    .
 +
 
 +
extension=php_pdo.dll
 +
extension=php_pdo_sqlite.dll
 +
extension=php_sockets.dll
 +
</source>
 +
 
 +
 
 +
The NanoWeb configuration is a minimal file based on the ''nanoweb-win.conf'' sample that ships with it, and required numerous absolute path definitions so the startup script will need to create the ''nanoweb.conf'' configuration at runtime. Here's the successful configuration:
 +
<source>
 +
ServerMode        = standalone
 +
SingleProcessMode = 1
 +
ListenInterface  = 0.0.0.0
 +
ListenPort        = 80
 +
ListenQueue      = 20
 +
 
 +
ConfigDir        = c:\MyWiki\nanoweb\conf
 +
TempDir          = c:\MyWiki\nanoweb\tmp
 +
PidFile          = c:\MyWiki\nanoweb\nanoweb.pid
 +
MimeTypes        = c:\MyWiki\nanoweb\conf\mime.types
 +
ServerLog        = c:\MyWiki\nanoweb\log\server.log default
 +
ServerLog        = c:\MyWiki\nanoweb\log\error.log warning+error
 +
LogDir            = c:\MyWiki\nanoweb\log
 +
Log              = access.log
 +
LoggerProcess    = 0
 +
 
 +
DocumentRoot      = c:\MyWiki\mediawiki
 +
DirectoryIndex    = index.php
 +
 
 +
KeepAlive        = 0
 +
RequestTimeout    = 15
 +
ChildLifeTime    = 21600
 +
 
 +
DefaultContentType = text/plain
 +
HostnameLookups  = 1
 +
HostnameLookupsBy = server
 +
LoadTheme        = default.theme
 +
ServerTheme      = default
 +
ServerName        = localhost
 +
ServerAdmin      = root@localhost
 +
ServerSignature  = min
 +
 
 +
DefaultHandler    = static
 +
ParseExt          = php CGI c:\MyWiki\php\php-cgi.exe
 +
ParseExt          = exe CGI $SCRIPT_FILENAME
 +
IgnoreDotFiles    = 1
 +
AllowPathInfo    = 1
 +
PathInfoTryExt    = php
 +
 
 +
ModulesDir        = C:\MyWiki\nanoweb\modules\
 +
LoadModule        = mod_static.php
 +
LoadModule        = mod_cgi.php
 +
 
 +
LoadModule        = mod_load_limit.php
 +
LoadLimit        = 8.0
 +
LoadLimitAction  = error
 +
LoadLimitError    = 503
 +
LoadLimitErrorMessage = Server load is too high (<b>%CUR_LOAD/%MAX_LOAD</b>), try again in a few moments.
 +
 
 +
LoadModule        = mod_pfilters.php
 +
FilterEnable      = 1
 +
 
 +
LoadModule        = mod_gzip.php
 +
GzipMaxRatio      = 90
 +
GzipLevel        = 5
 +
</source>
 +
 
 +
 
 +
The command to then run ''NanoWeb'' from this structure was as follows:
 +
<source>
 +
C:\MyWiki\php\php.exe -f c:\MyWiki\nanoweb\src\nanoweb.php -- --config=C:\MyWiki\nanoweb\nanoweb.conf
 +
</source>
 +
 
 +
 
 +
To then get the whole structure location-independent the command was expanded out into a generic batch file called ''wiki.bat'' which contains the following:
 +
<source>
 +
php\php.exe sys\cwd.php > %TMP%\cwd.bat
 +
call %TMP%\cwd.bat
 +
call sys\make-conf.bat
 +
start "%programfiles%\Internet Explorer\iexplore.exe" "%CD%\sys\splash.html"
 +
php\php.exe -f %CD%\nanoweb\src\nanoweb.php -- --config=%TMP%\nanoweb.conf
 +
</source>
 +
 
 +
 
 +
The script first runs a small PHP script called ''cwd.php'' which sets the CWD to the base of the portable structure. On important aspect of this script is that it sets it in the old DOS 8.3 path format because the ''modules'' directive in ''nanoweb.conf'' can't handle spaces even when the value is double-quoted. The ''cwd.php'' script uses the [http://www.optimumx.com/download/#SetSFN SetSFN.exe] utility to obtain the ''8.3'' name. Here's a listing of ''cwd.php'':
 +
<source lang="php">
 +
$j = dirname( __FILE__ );
 +
$sfn = array();
 +
while ( $j != ( $i = dirname( $j ) ) ) {
 +
$j = $i;
 +
if ( preg_match( '/^(.:).$/', $j, $m ) ) $k = $m[1];
 +
else {
 +
$k = exec( "sys\\SetSFN\\SetSFN.exe /F:\"$j\"" );
 +
preg_match( "/'(.+)'/", $k, $m );
 +
$k = $m[1];
 +
}
 +
array_unshift( $sfn, $k );
 +
}
 +
$sfn = implode( '\\', $sfn );
 +
echo( "cd $sfn" );
 +
</source>
 +
 
 +
 
 +
The ''wiki.bat'' script then calls a second script called ''make-conf.bat'' which creates a ''nanoweb.conf'' file in the systems ''%TMP% directory. This step needs to be done because the NanoWeb configuration requires absolute file locations, the script is able to use a file-template based on the configuration shown above and replace all the file paths with the ''%CD%''.
 +
 
 +
''Wiki.bat'' then starts up a browser loaded with an HTML page called ''splash.html'' which is designed to redirect to the wiki main page after a few seconds to give ''NanoWeb'' a chance to start up. Launching ''NanoWeb'' is the last thing the ''wiki.bat'' script does and this command doesn't return until the command window is closed which shuts the web server down.
 +
 
 +
Here's a screenshot of the portable structure running in a virtual box installed with Windows XP (that I'm allowed to use due to the COA sticker on my computer).
 +
 
 +
[[File:Win32nanowiki.jpg|550px]]
 +
 
 +
=== Installing MediaWikiLite as a Debian package (in progress) ===
 +
For Debian and Ubuntu based Linux users, I'm creating a deb package to install the trio, it will be installed as follows:
 +
<source>
 +
echo "deb http://packages.organicdesign.co.nz main/" >> /etc/apt/sources.list
 +
apt-get update
 +
apt-get install organicdesign-mediawikilite
 +
</source>
 +
 
 +
 
 +
Currently we don't have a self-contained folder structure that MediaWikiLite's can run out of, so you'll need to ensure that SQLite is installed into the PHP environment properly. It's important to use SQLite3 rather than 2 because the former supports more similar syntax for some SQL such as table creation. Aside from that, version 3 uses more compact files and executes more efficiently because it works via PHP's [http://nz2.php.net/manual/en/ref.pdo.php PDO functions].
 +
 
 +
To install NanoWeb and SQLite3 on a Debian based system use the following, I've added [http://xdebug.org/ xdebug] in as it's useful for logging function calls etc for testing:
 +
<source lang="bash">
 +
apt-get install nanoweb php5-cgi php5-cli php5-sqlite3 php5-xdebug
 +
</source>
 +
 
 +
 
 +
Check your ''phpinfo()'' to see if '''pdo_sqlite''' is listed, if not, try adding ''extension=php_pdo_sqlite.so'' into the dynamic extensions section of your ''php.ini''.
 +
 
 +
The default web root is ''/var/www/nanoweb'', so you can unpack a MediaWiki codebase into there and go through the install procedure from ''http://localhost''.
 +
 
 +
== Issues ==
 +
*Currently only one portable wiki can run at a time, and an existing web-server can't already be running in port 80
 +
**A hash of the portable dir's full pathname mapped into ports 10000 to 60000 could be a good way to allow multiple instances
 +
**Multiple instances have been tested successfully on multiple ports
 +
**The hashed port should in available from the env and the files such as logs in %TMP% should include the hashed port too
 +
*It often locks up when saving an article, restarting it shows that the save had worked though.
 +
*On intial install of the MediaWiki I got the following notice: Use of undefined constant SQLITE_SCHEMA - assumed 'SQLITE_SCHEMA' in C:\MyWiki\mediawiki\includes\db\DatabaseSqlite.php on line 302
  
 
== See also ==
 
== See also ==
*[[Extension talk:P2P.php]]
+
*[[PeerPedia]]
*[http://nanoweb.si.kz NanoWeb] ''- webserver with rewrite and other modules written in PHP''
+
*[http://www.mediawikilite.org www.mediawikilite.org] ''- example of MediaWiki 1.15.1 installed with SQLite''
*[http://devzone.zend.com/node/view/id/1086 DevZone PHP socket server example]
+
*[[MW:SQLite]]
*[http://www.linuxformat.co.uk/wiki/index.php/PHP_-_Sockets LinuxFormatWiki PHP socket server example]
+
*[[Wikipedia:SQLite]]
 
*[http://www.sqlite.org/lang.html SQL as understood by SQLite]
 
*[http://www.sqlite.org/lang.html SQL as understood by SQLite]
*[http://www.nagilum.net/unix/mysql2sqlite.pl mysql2sqlite.pl]
+
*[http://www.bambalam.se/bamcompile/#whatis PHP2EXE converter] ''- currently PHP4.4 only''
*[http://forums.mysql.com/read.php?145,68269,92627 mysql2sqlite.sh]
+
*[http://wordpress.org/extend/plugins/pdo-for-wordpress/ SQLite for WordPress]
 +
*[[w:Uniform Server|Uniform Server]] ''- portable WAMP''
 +
*[http://lifehacker.com/354005/run-your-personal-wikipedia-from-a-usb-stick MediaWiki on XAMPP]

Latest revision as of 18:10, 22 May 2015

Legacy.svg Legacy: This article describes a concept that has been superseded in the course of ongoing development on the Organic Design wiki. Please do not develop this any further or base work on this concept, this is only useful for a historic record of work done. You may find a link to the currently used concept or function in this article, if not you can contact the author to find out what has taken the place of this legacy item.

The idea of MediaWikiLite is to allow the current MediaWiki codebase to run as a standalone server without requiring a database server or web-server so that it can be used like a wiki on a stick. This forms the foundation for a number of alternative uses for the MediaWiki software in environments where the current LAMP architecture is too resource intensive.

There are a number of personal desktop wiki's out there, but they do not use the MediaWiki parser, and making a fork of the parser code defeats the purpose. Also, embedded devices such as PDA's, iPod's and iPhone's can only run lite applications effectively and getting MediaWiki onto them would be very useful, especially if it could synchronise with a web-based mirror when an internet connection becomes available.

A lite version of MediaWiki would make a possible candidate for a client side wiki interface to a P2P article space, i.e. a decentralised Wikipedia or PeerPedia.

As of version 1.13, MediaWiki natively supports the SQLite database which is a program library compiled in to PHP instead of running as a separate server outside of the PHP environment. A running instance of MediaWiki 1.15.1 using the SQLite database can be seen at mediawikilite.org to test the current functionality.

To remove the need of an external web-server such as Apache or IIS, we're using NanoWeb which is a web-server entirely written entirely in PHP and comes with a number of modules such as a mod-rewrite clone for friendly URL's. It can execute CGI scripts using a normal CGI module or a FastCGI module.

Portable folder structure (still in testing)

I've packaged PHP/SQLite, NanoWeb and MediaWiki together into a self-contained folder structure which can be downloaded from here for testing purposes. The wiki is started by running the wiki.bat file in the base of this structure. Currently it only runs in Win32 environments, but soon the one structure will be able to be moved between Linux, OS X and Windows. The sysop user is WikiSysop with password admin. The database is in a file called wikidb.sqlite in the wikis images directory to be sure it's a writeable location and that it's bundled in with the uploaded file content of the wiki.

Here's a tree view showing the main items in the structure:

The php directory is a standard PHP installation except for some changes in the extension section.

The nanoweb directory is the current NanoWeb condebase with no changes.

The mediawiki directory is a standard current MediaWiki code-base, except for LocalSettings.php and extensions.

The sys directory contains various scripts required during wiki startup.

The wikidb.sqlite file is the entire wiki database containing all the articles and history (not the images though).

Use the wiki.bat file to start the wiki, soon this will work across platforms, but currently only works on Win32.

Development notes

Getting the portable structure to run under Linux based systems

in progress...

Getting the portable structure to run under OS X

in progress...

Getting the portable structure to run under Win32

I've successfully created a self-contained folder structure containing NanoWeb and PHP which is able to be run from the command line without any changes to the OS. My test folder structure was C:\MyWiki and required config files to be created for both applications which I placed into the root of each (C:\MyWiki\nanoweb and C:\MyWiki\php). In the case of php.ini the only change required was to enable some extensions as follows:

extension_dir = ./php/ext

    .
    .
    .

extension=php_pdo.dll
extension=php_pdo_sqlite.dll
extension=php_sockets.dll


The NanoWeb configuration is a minimal file based on the nanoweb-win.conf sample that ships with it, and required numerous absolute path definitions so the startup script will need to create the nanoweb.conf configuration at runtime. Here's the successful configuration:

ServerMode        = standalone
SingleProcessMode = 1
ListenInterface   = 0.0.0.0
ListenPort        = 80
ListenQueue       = 20

ConfigDir         = c:\MyWiki\nanoweb\conf
TempDir           = c:\MyWiki\nanoweb\tmp
PidFile           = c:\MyWiki\nanoweb\nanoweb.pid
MimeTypes         = c:\MyWiki\nanoweb\conf\mime.types
ServerLog         = c:\MyWiki\nanoweb\log\server.log default
ServerLog         = c:\MyWiki\nanoweb\log\error.log warning+error
LogDir            = c:\MyWiki\nanoweb\log
Log               = access.log
LoggerProcess     = 0

DocumentRoot      = c:\MyWiki\mediawiki
DirectoryIndex    = index.php

KeepAlive         = 0
RequestTimeout    = 15
ChildLifeTime     = 21600

DefaultContentType = text/plain
HostnameLookups   = 1
HostnameLookupsBy = server
LoadTheme         = default.theme
ServerTheme       = default
ServerName        = localhost
ServerAdmin       = root@localhost
ServerSignature   = min

DefaultHandler    = static
ParseExt          = php CGI c:\MyWiki\php\php-cgi.exe
ParseExt          = exe CGI $SCRIPT_FILENAME
IgnoreDotFiles    = 1
AllowPathInfo     = 1
PathInfoTryExt    = php

ModulesDir        = C:\MyWiki\nanoweb\modules\
LoadModule        = mod_static.php
LoadModule        = mod_cgi.php

LoadModule        = mod_load_limit.php
LoadLimit         = 8.0
LoadLimitAction   = error
LoadLimitError    = 503
LoadLimitErrorMessage = Server load is too high (<b>%CUR_LOAD/%MAX_LOAD</b>), try again in a few moments.

LoadModule        = mod_pfilters.php
FilterEnable      = 1

LoadModule        = mod_gzip.php
GzipMaxRatio      = 90
GzipLevel         = 5


The command to then run NanoWeb from this structure was as follows:

C:\MyWiki\php\php.exe -f c:\MyWiki\nanoweb\src\nanoweb.php -- --config=C:\MyWiki\nanoweb\nanoweb.conf


To then get the whole structure location-independent the command was expanded out into a generic batch file called wiki.bat which contains the following:

php\php.exe sys\cwd.php > %TMP%\cwd.bat
call %TMP%\cwd.bat
call sys\make-conf.bat
start "%programfiles%\Internet Explorer\iexplore.exe" "%CD%\sys\splash.html"
php\php.exe -f %CD%\nanoweb\src\nanoweb.php -- --config=%TMP%\nanoweb.conf


The script first runs a small PHP script called cwd.php which sets the CWD to the base of the portable structure. On important aspect of this script is that it sets it in the old DOS 8.3 path format because the modules directive in nanoweb.conf can't handle spaces even when the value is double-quoted. The cwd.php script uses the SetSFN.exe utility to obtain the 8.3 name. Here's a listing of cwd.php:

$j = dirname( __FILE__ );
$sfn = array();
while ( $j != ( $i = dirname( $j ) ) ) {
	$j = $i;
	if ( preg_match( '/^(.:).$/', $j, $m ) ) $k = $m[1];
	else {
		$k = exec( "sys\\SetSFN\\SetSFN.exe /F:\"$j\"" );
		preg_match( "/'(.+)'/", $k, $m );
		$k = $m[1];
	}
	array_unshift( $sfn, $k );
}
$sfn = implode( '\\', $sfn );
echo( "cd $sfn" );


The wiki.bat script then calls a second script called make-conf.bat which creates a nanoweb.conf file in the systems %TMP% directory. This step needs to be done because the NanoWeb configuration requires absolute file locations, the script is able to use a file-template based on the configuration shown above and replace all the file paths with the %CD%.

Wiki.bat then starts up a browser loaded with an HTML page called splash.html which is designed to redirect to the wiki main page after a few seconds to give NanoWeb a chance to start up. Launching NanoWeb is the last thing the wiki.bat script does and this command doesn't return until the command window is closed which shuts the web server down.

Here's a screenshot of the portable structure running in a virtual box installed with Windows XP (that I'm allowed to use due to the COA sticker on my computer).

Win32nanowiki.jpg

Installing MediaWikiLite as a Debian package (in progress)

For Debian and Ubuntu based Linux users, I'm creating a deb package to install the trio, it will be installed as follows:

echo "deb http://packages.organicdesign.co.nz main/" >> /etc/apt/sources.list
apt-get update
apt-get install organicdesign-mediawikilite


Currently we don't have a self-contained folder structure that MediaWikiLite's can run out of, so you'll need to ensure that SQLite is installed into the PHP environment properly. It's important to use SQLite3 rather than 2 because the former supports more similar syntax for some SQL such as table creation. Aside from that, version 3 uses more compact files and executes more efficiently because it works via PHP's PDO functions.

To install NanoWeb and SQLite3 on a Debian based system use the following, I've added xdebug in as it's useful for logging function calls etc for testing:

apt-get install nanoweb php5-cgi php5-cli php5-sqlite3 php5-xdebug


Check your phpinfo() to see if pdo_sqlite is listed, if not, try adding extension=php_pdo_sqlite.so into the dynamic extensions section of your php.ini.

The default web root is /var/www/nanoweb, so you can unpack a MediaWiki codebase into there and go through the install procedure from http://localhost.

Issues

  • Currently only one portable wiki can run at a time, and an existing web-server can't already be running in port 80
    • A hash of the portable dir's full pathname mapped into ports 10000 to 60000 could be a good way to allow multiple instances
    • Multiple instances have been tested successfully on multiple ports
    • The hashed port should in available from the env and the files such as logs in %TMP% should include the hashed port too
  • It often locks up when saving an article, restarting it shows that the save had worked though.
  • On intial install of the MediaWiki I got the following notice: Use of undefined constant SQLITE_SCHEMA - assumed 'SQLITE_SCHEMA' in C:\MyWiki\mediawiki\includes\db\DatabaseSqlite.php on line 302

See also