Local installation

Trying to install BNT? No guarantees we can help you (especially if you're hosting it on windows) but we''ll try.

Post Reply
Rincewind
Posts: 64
Joined: Thu Nov 03, 2016 5:16 am

Local installation

Post by Rincewind » Wed Nov 30, 2016 2:21 am

Hey TMD,

just trying to set this up locally on my mac. So far I've gotten the game to install, created the universe..
but I get these warnings:

Code: Select all

Strict Standards: Non-static method ADODB_Session::_init() should not be called statically in /Users/username/Sites/bnt/backends/adodb/session/adodb-session.php on line 919

Strict Standards: Non-static method ADODB_Session::open() should not be called statically in /Users/username/Sites/bnt/backends/adodb/session/adodb-session.php on line 451

Strict Standards: Non-static method ADODB_Session::close() should not be called statically in /Users/username/Sites/bnt/backends/adodb/session/adodb-session.php on line 451

Strict Standards: Non-static method ADODB_Session::read() should not be called statically in /Users/username/Sites/bnt/backends/adodb/session/adodb-session.php on line 451

Strict Standards: Non-static method ADODB_Session::write() should not be called statically in /Users/username/Sites/bnt/backends/adodb/session/adodb-session.php on line 451

Strict Standards: Non-static method ADODB_Session::destroy() should not be called statically in /Users/username/Sites/bnt/backends/adodb/session/adodb-session.php on line 451

Strict Standards: Non-static method ADODB_Session::gc() should not be called statically in /Users/username/Sites/bnt/backends/adodb/session/adodb-session.php on line 451

Warning: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression' in /Users/username/Sites/bnt/global_cleanups.php on line 25

Notice: ob_start(): failed to create buffer in /Users/username/Sites/bnt/global_cleanups.php on line 25
and when I try to log in I get:

Code: Select all

Session Replace: Table 'bnt.bnt_sessions' doesn't exist

Code: Select all

Ξ Sites/bnt → php --version
PHP 5.6.27 (cli) (built: Nov 29 2016 14:39:03)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Ξ Sites/bnt → mysql --version
mysql  Ver 14.14 Distrib 5.7.16, for osx10.11 (x86_64) using  EditLine wrapper
Any ideas what could be wrong?

User avatar
TheMightyDude
Site Admin
Posts: 245
Joined: Thu Apr 17, 2014 9:15 am

Re: Local installation

Post by TheMightyDude » Wed Nov 30, 2016 2:38 pm

It seems like ADODB is having issues due to it being old, which is why we really wanted to move away from using it, we did start to move over to PHP PDO before development stopped.

And due to issues in ADODB it failed to create the bnt_sessions table.

I am unable to test it myself due to not owning a mac, also I have not long rebuilt my PC and re-installed Windows 10 which now boots up Windows 7 in 2 to 4 seconds :shock: so I cannot even look at any code.
TheMightyDude::Blacknova Development.
Development Blog Twitter Twitch

User avatar
TheMightyDude
Site Admin
Posts: 245
Joined: Thu Apr 17, 2014 9:15 am

Re: Local installation

Post by TheMightyDude » Wed Nov 30, 2016 2:59 pm

One thing I forgot to ask was, do you have the empty file in your bnt root directory called "dev" (without the quotes), if so remove it and re-run the database and see if it creates the tables etc.

This is due to PHP STRICT Standards being turned on and ADODB is very old including our bad code :P
TheMightyDude::Blacknova Development.
Development Blog Twitter Twitch

Rincewind
Posts: 64
Joined: Thu Nov 03, 2016 5:16 am

Re: Local installation

Post by Rincewind » Thu Dec 01, 2016 4:10 am

Hey, thanks for the reply!

Unfortunately, was not able to resolve the issue. 'dev' file was not there to begin with, and any subsequent tries to re-install and changing details didn't yield better results.

Funny thing is, the creation of the universe says 'Creating session table' 'Passed' as seen here:

Code: Select all

Dropping Tables
Dropping all tables	Failed
Hover over the failed line to see the error.
Dropping stage complete.

Creating Tables
Creating languages Table	Passed
Creating links Table	Passed
Creating planets Table	Passed
Creating traderoutes Table	Passed
Creating ships Table	Passed
Creating universe Table	Passed
Creating zones Table	Passed
Creating ibank_accounts Table	Passed
Creating IGB_transfers Table	Passed
Creating teams Table	Passed
Creating news Table	Passed
Inserting first news item	Inserted
Creating messages Table	Passed
Creating xenobe Table	Passed
Creating sector_defence Table	Passed
Creating scheduler Table	Passed
Creating ip_bans Table	Passed
Creating logs Table	Passed
Creating session Table	Passed
Creating bounty Table	Failed
Creating adodb_logsql Table	Passed
Bounty table fails with:

Code: Select all

1101: BLOB, TEXT, GEOMETRY or JSON column 'SESSDATA' can't have a default value

User avatar
TheMightyDude
Site Admin
Posts: 245
Joined: Thu Apr 17, 2014 9:15 am

Re: Local installation

Post by TheMightyDude » Thu Dec 01, 2016 5:07 am

Erm what code are you using?
Is it the SVN Codebase or a file download?
TheMightyDude::Blacknova Development.
Development Blog Twitter Twitch

Rincewind
Posts: 64
Joined: Thu Nov 03, 2016 5:16 am

Re: Local installation

Post by Rincewind » Thu Dec 01, 2016 1:16 pm

file download

User avatar
TheMightyDude
Site Admin
Posts: 245
Joined: Thu Apr 17, 2014 9:15 am

Re: Local installation

Post by TheMightyDude » Thu Dec 01, 2016 1:24 pm

Rincewind wrote:file download
Ok, bnt-0.55 or bnt-0.66 ?

If its bnt-0.66, try 0.55 and see if that works, I know its old, just wanted to see what issues popup for that version.

But before you try the other version, try the fix in my next reply below...
TheMightyDude::Blacknova Development.
Development Blog Twitter Twitch

User avatar
TheMightyDude
Site Admin
Posts: 245
Joined: Thu Apr 17, 2014 9:15 am

Re: Local installation

Post by TheMightyDude » Thu Dec 01, 2016 3:02 pm

Ok, I have a quick fix that will resolve those several static warnings, but you may see other errors / warnings and notices in other places, so be prepared.

open up file backends/adodb/session/adodb-session.php around line 451, you will see the following lines of code:

Code: Select all

    function _init() {
        session_module_name('user');
        session_set_save_handler(
            array('ADODB_Session', 'open'),
            array('ADODB_Session', 'close'),
            array('ADODB_Session', 'read'),
            array('ADODB_Session', 'write'),
            array('ADODB_Session', 'destroy'),
            array('ADODB_Session', 'gc')
        );
    }
change it to the following:

Code: Select all

    function _init() {
        session_module_name('user');
        session_set_save_handler(
            array($this, 'open'),
            array($this, 'close'),
            array($this, 'read'),
            array($this, 'write'),
            array($this, 'destroy'),
            array($this, 'gc')
        );
    }
 
Then go to around line 919 and you should see the following lines:

Code: Select all

ADODB_Session::_init();
if (empty($ADODB_SESSION_READONLY))
 
Change that line to the following lines:

Code: Select all

$handler  = new ADODB_Session();
$handler->_init();

if (empty($ADODB_SESSION_READONLY))
Let me know what errors you have now and did it create the sessions table?
Last edited by TheMightyDude on Thu Dec 01, 2016 3:22 pm, edited 1 time in total.
Reason: Had to add an extra change of code in, but it will probably break some other place :(
TheMightyDude::Blacknova Development.
Development Blog Twitter Twitch

Rincewind
Posts: 64
Joined: Thu Nov 03, 2016 5:16 am

Re: Local installation

Post by Rincewind » Fri Dec 02, 2016 2:17 am

Thanks heaps man going to try it in a bit! :)

User avatar
TheMightyDude
Site Admin
Posts: 245
Joined: Thu Apr 17, 2014 9:15 am

Re: Local installation

Post by TheMightyDude » Fri Dec 02, 2016 2:57 am

Rincewind wrote:Thanks heaps man going to try it in a bit! :)
A thing to be aware of is that ADOdb is very old now and due to the nature of PHP being upgraded to newer versions things stop working, like you can see in ADOdb, so be prepared for more issues in that library.

Like I have said in other posts previously I am not a fan of doing fixes for other peoples code / projects / libraries etc.

The reason being it takes up my time and becomes an issue when the original owner of said library does an update, due to I have to then keep track of all the changes that I have done and re-do them in the newer version if needed.
TheMightyDude::Blacknova Development.
Development Blog Twitter Twitch

Post Reply