1

I have done a fresh installation on my local development machine of MediaWiki 1.24.2.

I have installed Scribunto and checked it is installed correctly on the list of extensions.

I'm getting an error when I try and create an InfoBox. The error is:

Lua error: Internal error: The interpreter exited with status 2

These are the steps I have taken the following steps to try and fix this.

I have been to the Mediawiki Scribunto page

I have added these lines to my LocalSettings.php file:

$wgScribuntoEngineConf['luastandalone']['memoryLimit'] = 209715200; # bytes
$wgMaxShellMemory = 204800; # in KB

This has not fixed things. I'm a but confused as to how to switch on error logging. The help page just says:

Assigning a file path to $wgScribuntoEngineConf['luastandalone']['errorFile'] and examining that output can be valuable in diagnosing memory allocation errors.

How do I assign a file path? - Solved Thanks for the help with this.

I enclose a [link][2] to my php.ini file and my LocalSettings.php file (Zipped together)

UPDATE - I have now managed to add a log file and the error in the log file is:

/var/www/extensions/Scribunto/engines/LuaStandalone/binaries/lua5_1_5_linux_32_generic/lua: Syntax error: "(" unexpected

UPDATE TWO

These are the full steps I take to replicate the error:

Start by checking for any package updates available and installing them

sudo apt-get update
sudo apt-get upgrade

Now install Apache, PHP and MySQL

sudo apt-get install apache2 -y
sudo apt-get install php5 libapache2-mod-php5 -y
sudo apt-get install mysql-server php5-mysql -y
sudo apt-get install php-apc php5-intl imagemagick
sudo apt-get install phpmyadmin

We can check the internal IP address of our Raspberry Pi with the following command (Make a note of it)

hostname -I

We can now create a database for our new MediaWIki installation. Start by logging in as root using the password you created earlier

mysql -u root -p

Here we are adding database=mediawikidb user=mediawikiuser and password=mediawikipassword:

CREATE DATABASE mediawikidb;
CREATE USER mediawikiuser@localhost IDENTIFIED BY 'mediawikipassword';
GRANT index, create, select, insert, update, delete, alter, lock tables on mediawikidb.* TO mediawikiuser@localhost;

Now we can make some changes to php.ini so we can increase the maximum file size and memory limit

cd /etc/php5/apache2/ nano php.ini

Replace 'upload_max_filesize = 2M' with 'upload_max_filesize = 64M'

Replace 'post_max_size = 8M' with 'post_max_size = 64M'

Save the file

Now we are going to empty the /var/www folder and change its ownership to pi

cd /var/www
sudo chown pi: .
sudo rm *

Now we can download MediaWiki, uncompress it and copy it into /var/www

mkdir /var/www/mediawiki
wget http://releases.wikimedia.org/mediawiki/1.24/mediawiki-1.24.2.tar.gz
tar -xvzf mediawiki-*.tar.gz
sudo mv mediawiki-*/* /var/www/

Now we can restart the relevant services

sudo service apache2 restart
sudo service mysql restart

Now open a browser and go to localhost and start the installation

To Complete Installation copy LocalSettings.php to /var/www/mediawiki

Now install Scribunto

Download from http://www.mediawiki.org/wiki/Special:ExtensionDistributor/Scribunto

tar -xzf Scribunto-REL1_24-b060fbd.tar.gz -C /var/www/mediawiki/extensions

sudo nano /etc/mediawiki/LocalSettings.php

add these lines at the end of the file and save

require_once "$IP/extensions/Scribunto/Scribunto.php";

$wgScribuntoDefaultEngine = 'luastandalone';

$wgScribuntoEngineConf['luastandalone']['memoryLimit'] = 209715200; # bytes

$wgMaxShellMemory = 204800; # in KB

$wgScribuntoEngineConf['luastandalone']['errorFile'] = '/var/tmp/luaerror.log';

chmod -R 777 /var/www/mediawiki/extentions/Scribunto/engines/LuaStandalone/

Now visit 'http://en.wikipedia.org/wiki/Special:Export' and enter Template:Infobox in the big box. Tick all three boxes and click Export

Open the file in Notepad or similar and do a find and replace text/plain with CONTENT_FORMAT_TEXT

Login to MediaWiki and go to Special:Import

Once everything has imported correctly go to the homepage and enter this at the top of the page:

{{Infobox
|title        = test Infobox
|header1 = Main Heading
|header2 = First set of data
|label2  = Label
|data2   = Data
|header3 = Remove this line (optional)
|label3  = More Label
|data3   = More data
}}

Many thanks

  • `status 2` means memory allocation error, so try raising available memory for Lua, and for PHP. I'm also flagging this as OT, as it is not a programming question – leo Apr 10 '15 at 08:11
  • Hi. I assume OT is off topic? I would have thought the part of the question about error logging is OK? Can you suggest where I might log my question? Best wishes – Peter Jones Apr 10 '15 at 08:38
  • I would try one of the [MediaWiki mailing lists](https://www.mediawiki.org/wiki/Mailing_lists), or possibly ask at [ServerFault](http://serverfault.com/). BTW, the `$wgScribuntoEngineConf['luastandalone']['errorFile'] ` is just the name of a log file. You can use anything, e.g. `$wgScribuntoEngineConf['luastandalone']['errorFile'] = /var/log/luaerror.log` – leo Apr 10 '15 at 09:15
  • Just to note that you need quotes around the log path and an semi-colon at the end of the line. The log is telling me that: /var/www/extensions/Scribunto/engines/LuaStandalone/binaries/lua5_1_5_linux_32_generic/lua: Syntax error: "(" unexpected – Peter Jones Apr 10 '15 at 16:14
  • I have raised a bug here https://phabricator.wikimedia.org/T95716 – Peter Jones Apr 10 '15 at 16:31

1 Answers1

1

Finally fixed. I did:

sudo apt-get install lua

Then added the following to my LocalSettings.php

$wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua5.1';

I assume the lua binary included with Scribunto is not ok with the Raspberry Pi?

  • This reply is a bit late, but you're exactly right. Scribunto only builds [its Lua binaries](https://phabricator.wikimedia.org/diffusion/ELUA/browse/master/engines/LuaStandalone/binaries/) for Windows 32/64 bit x86, Linux 32/64 bit x86, and Mac OSX x86. As the Raspberry Pi uses an ARM processor, none of these binaries will work. – Jack Taylor Apr 28 '17 at 23:41