ScrapYard Armory

A BattleTech weblog


Portable MercRoster

Back in September of last year I reviewed the open source BattleTech tracking tool MercRoster.  After helping a reader through the process of setting up their own instance I thought it would be appropriate to provide a step by step guide to make it portable.

MercRoster is a great tool and I want to show how easy it can be to setup and use.  All you will need is an internet connection (you got here didn’t you?) and a USB stick.

My web stats tell me the vast majority of ScrapYardArmory readers use Windows, so that’s what I’ll use in this post.


Visit the XAMPP project website and download the latest ZIP option.

Extract the files into the root of your thumb drive. For me, that ends up being the E: drive but your system is likely to be different.  Inside the xampp directory you will find a executable batch file called setup_xampp.  Go ahead and run it.  It’s job is to figure out what drive letter you are using and map xampp correctly.

Setting Up PHP

To make sure we have a smooth experience I have found that a small modificcation is needed to the php.ini configuration file.  On your thumb drive locate the php.ini file in the following directory E:/xampp/php.

Find the line in the file that sets up error reporting.  It will start with something like error_reporting = E_ALL | E_STRICT.  Change it to the following: error_reporting = E_ALL & ~E_NOTICE.

Running XAMPP

In the xampp directory find the xampp-control executable and run it.  Start both Apache and MySql.

Once they are up and running you can head over to your favorite web browser and go to http://localhost.

You should see the following screen if everything is up and running.  If you don’t, check the XAMPP icon or the Xampp control panel  to see whats the matter.

Select your language to get to the next screen and on to the next step.

MercRoster Installation

Next, head back to and download MercRoster.

Extract the files to your thumb drive web directory.  The directory on my machine was E:/xampp/htdocs.  You will have to replace the index.php provided by the xampp installation with the new one from MercRoster.

Back in your web browser, access PhpMyAdmin at the following address: http://localhost/phpmyadmin.  At the top of the screen click on the tab titled SQL.  In your MercRoster directory open up the file mercenary_roster.sql.  Copy all and paste into the SQL text box in your browser.  Click GO and give it a generous few seconds to build your database.

Final Configuration

We are getting close.  Go to the directory E:/xampp/htdocs/htdocs.  You will find two files, appsetup and dbsetup.

In appsetup change your site path to the following: $sitepath=”http://localhost/”.

In dbsetup change your db user and password to the following: $dbuser = ‘root’; and $dbpass = ”;

These are the default settings and are fine for a local thumb drive portable app.  If you ever attempt to use MercRoster on a real webserver, you will need to change your mysql password to something a bit more secure. You can find password settings in the Privileges Tab in PhpMyAdmin.

Now everything should be setup.  Open your browser and point to http://localhost and you should be treated to a fully functional MercRoster installation.  It’s your sandbox to play in and is a great tool to help tell your BattleTech unit’s story.  Best of all it fits in your pocket and is easily transported to wherever your game takes you.

Let me know if you have any trouble with this installation guide and I’ll be happy to help you out if I can spare the time.

Posted under Articles
  1. Rob Said,

    I have come up withe following error when trying to install merc roster. Any help would be great.

    SQL ERROR SELECT ipaddress, lastlogin FROM guests WHERE logged=’1′;

    The only difference I have made is d/l the lite xampp for a usb.


  2. Robin Said,

    Tried all this stuff cause this looks neat. Get the following errors:

    Notice: Undefined variable:queryArray in D:\xampp\htdocs\includes\GuestFunctions.php on line 64

    Notice: Use of undefined constant logged – assumed ‘logged’ in D:\xampp\htdocs\includes\GuestFunctions.php on line 44

    What am I missing?

  3. Brian Said,

    Did you edit your PHP.INI file with the error_reporting = E_ALL & ~E_NOTICE. line?


  4. Josh Said,

    Hi there Brian, just stumbled upon your blog and this great guide yesterday. I’ve gone through the install and I’m getting a similar error as Robin:

    Warning: mysql_query() expects parameter 2 to be resource, null given in F:\xampp\htdocs\includes\DBFunctions.php on line 13

    Warning: mysql_close() expects parameter 1 to be resource, null given in F:\xampp\htdocs\includes\DBFunctions.php on line 14
    SQL ERROR SELECT ipaddress, lastlogin FROM guests WHERE logged=’1′;

    I have indeed edited my php.ini file as shown in the guide. Any ideas?

  5. Brian Said,

    Hey Josh, I may have the solution for you.

    In dbsetup.php change the first line from…

  6. Brian Said,

    gah! my comment filtered out the change…

    in dbsetup, add “php” tot he first line after the question mark.

    I’ll send you an email as well…

  7. Nick Said,

    I am getting the same error as Josh. I don’t know where to find dbsetup.php though.

  8. Brian Said,

    Hi Nick,

    I’ve cloned MercRoster to GitHub,

    dbsetup can be found in mercroster/htdocs/

    Hope this helps!

  9. Nick Said,

    Thanks for your quick reply. I edited dbsetup.php in the mean time, but I am getting a different kind of error…

    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in G:\xampp\htdocs\htdocs\dbsetup.php on line 5

    Warning: mysql_connect(): Access denied for user ‘INSERT_USER’@’localhost’ (using password: YES) in G:\xampp\htdocs\htdocs\dbsetup.php on line 5
    Could not connect: Access denied for user ‘INSERT_USER’@’localhost’ (using password: YES)

    My appsetup.php

    My dbsetup.php

  10. Nick Said,

    Hm, actual code got formated… anyway.



Add A Comment