Installing MantisBT On a PHP/MySQL Web Server: A Tale of Tears, Tenacity, and Triumph
Keywords: linux, mantisbt, bug, issue, tracking, web, collaboration, team, hosting, server, terminal, github, 000webhost, free, debug, yonder, dynamics, jira, composer, json, vim, filezilla, ftp, php, mysql, postgresql, http, css
This is my first foray into blogging/tech reporting. Constructive critique is very much welcomed.
Sunday, July 9th, 2017 // 14:35 // Better Buzz Coffee, Pacific Beach, CA
The Need
As coach and former software lead for the UC San Diego robotics team Yonder Dynamics, I am driven to help this year’s software group adopt helpful new standards, platforms, and development procedures. One of my aims is to introduce members to proper issue tracking software, which allows one to report on project bugs and to-do items. Good issue tracking software also supports scheduling and assignment, allowing users to delegate bug fixes and deadlines to other individuals, as well as make notes on their progress.
The immediate solution: JIRA. An industry standard, this issue tracking software by Atlassian often shows up in many software job listings (hence my familiarity). However, JIRA is paid software, something rather inconvenient for a team that’s strapped for cash.
So my first task: find free issue tracking software.
Based off of a recommendation by Cai Yeo (EE Lead for Yonder Dynamics), I opt for MantisBT, a free open source tool for bug tracking and collaboration.

It’s a fantastic piece of software with a pleasing interface. Within minutes, I’m assigning, viewing, and making notes on issues.
Now what?
Well — now that I had a bug issue tracker software, I need a place to host it for my teammates. I’m not going to run it on my laptop 24–7, after all.
First, I make a list of my software requirements. According to the MantisBT system requirements, I need a server that supports PHP and MySQL (or PostgreSQL).
My gut reaction: make a github.io page. “Pages” is a free web hosting service by GitHub. However, after researching their server information, I find this:

With GitHub Pages off the table, I then consider the web host we use for our team’s website: Squarespace. From their support FAQ:

0 for 2. I resort to man’s second best friend (Google) and find several good reviews on a free PHP and MySQL hosting service: 000webhost.

I’ve found my host. Now what?
Now I need to install MantisBT on the server. Well, if you can, check first to see if your file manager (i.e. cPanel) allows you to install MantisBT with a tool such as Softaculous. If not, we’ll do install it ourselves.
First, I download the latest version of MantisBT from github.
I then go to my file manager on 000webhost:

Clicking on “upload files,” I see that I can only upload individual files, and not folders. This is inconvenient — I want to only upload the a “mantisbt” folder containing all of my files. I decide to use an FTP client. After a quick install on my Linux machine:
$ sudo apt-get install filezilla
I now have FileZilla, a free FTP solution. At the top of FileZilla is a prompt: host name, username, and password.

To find these, I access my settings on 000webhost:

I type them into my FileZilla and connect.

I navigate to my mantisbt folder in my Linux’s file system, and simply drag it into the public_html.

This will take a few minutes. Checking my file manager:

I then followed the instructions on MantisBT’s website, visiting my website’s (url)/mantisbt/admin/install.php file in my browser. Before doing this, make sure your website is published. If you’re still getting the “build your website” setup page on 000webhost, go ahead and click “I’ve already built my website!” at the bottom of the page.
Enter the debugging stage.
If the above instructions brought you to the MantisBT login page, congratulations. Otherwise, you may have run into a similar error as I did:

Failed to open stream: No such file or directory […] mantisbt/vendor/autoload.php.
Taking a quick look inside of the mantisbt folder confirms that the vendor/ folder doesn’t exist. Spooky. Time for the forums.
After a brief period of googling and forum hopping, I find this issue thread. It appears that the problem is with mantisbt/composer.json. I open my Linux terminal and navigate to the mantisbt folder.
$ sudo apt-get install composer && sudo composer install

After a momentary spike of disbelief, I realized I hadn’t yet installed PHP on my Linux computer.
$ sudo apt-get install php

I observe that the main issue is with dapphp/securimage in the composer.json file.

I remove line 12.
$ sudo composer update
I get another error, this time for phpunit. I remove the corresponding line in composer.json, and try again.

I quickly check my mantisbt folder, and sure enough, the vendor folder now exists, with the autoload.php file I need.

I go back to FileZilla, deleting and re-uploading everything, just to be sure. Crossing my fingers, I visit (my url)/mantisbt/admin/install.php in my browser.

Celebrating internally, butt aching from the wood chair in this small albeit cute coffee house, we continue.

Fill in the fields for Username, Password, Admin Username, Admin Password. Set your timezone. Click “Install/Upgrade Database.”
Bug #2

It appears that an error is occurring when connecting to the database. I revisit the MantisBT install documentation:
I try different combinations of hostnames, usernames, and passwords, and can’t seem to get past this error. I’m getting an “access denied” error, which means I’m either accessing the server with the wrong credentials, or accessing the wrong server (at the wrong hostname). Does my MySQL server even exist?
I navigate to the “Manage database” icon in my 000webhost panel. Sure enough, I need to create a MySQL database. I click “New Database” and input a desired username, server name, and password.

I then use the DB Name and DB User along with “localhost” in my install.php web browser page. I leave the Admin user/passwords blank.

Click “Continue.”

CAPTCHA
Nearly there. Upon signing up for a new account, I run into this issue:

According to this thread, I need to disable captcha inside of the mantisbt/config/config_inc.php file. I added the following line:
$g_signup_use_captcha = OFF;
And I re-upload using FileZilla.

Enter info, click “Signup”:

After clicking the verification link in my email, I achieve victory.

All done.
Next step? Harangue teammates. This tribulation will not go unrewarded.
Cheers!