Seeing "/cgi-bin/ultimatebb.cgi" tells me that you are at least on UBB-Classic v6. The earlier versions, UBB v2000 to UBB v5.x, were "/cgi-bin/Ultimate.cgi" and "/cgi-bin/ultimate.cgi" respectively.

1) You will first need to upgrade your UBB-Classic 6 to UBB.threads 6.
UBB.threads 6 requires PHP 4 and will not work with PHP 5 or newer. UBB.threads 6 was released at the end of 2003.

2) Then you can directly upgrade your UBB.threads 6 to UBB.threads 7.5.6. I Believe this step also requires PHP 4.
For that procedure, you can follow the directions listed here:
https://www.ubbcentral.com/doc_import.php

Once you are at UBB.threads 7.5.6, you can then switch to PHP 5.4 - 5.6 and upgrade directly to the most current UBB.threads release version at this time, which is UBB.threads 7.6.2.

TIP:
If you dont have a Linux box that you can easily change php versions with, this procedure can be done on a Windows box (or VM) using XAMPP. Then exporting your files and database and importing them to your Linux server and modifying your /includes/config.inc.php file with the correct paths:

XAMPP for Windows 1.6.8 [PHP 4.4.9]
and then
XAMPP for Windows 5.6.38 [PHP 5.6.38]

ABOUT XAMPP: https://www.apachefriends.org/index.html
DOWNLOADS: https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/

A word of caution when working with Windows and SQL Databases, is that you need force case sensitive table names.

in C:\xampp\mysql\bin
FIND: [mysqld]
PLACE UNDER IT: lower_case_table_names = 2
So that it looks like this:
Code
# The MySQL server
[mysqld]
lower_case_table_names = 2
port= 3306

NOTES:
UBB.threads 7.6.2 supports PHP 5.3 to PHP 5.6
UBB.threads 7.6.2 is the last major version which does not support PHP 7.
UBB.threads 7.7.0 and going forward, will support PHP 5.5+ and PHP 7.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com