Fixes for: HTTP 500 error, Array to string conversion and PHP7.0

sfjuocekr / 2016-09-18 21:56:05   

I am only able to ask a question, anyway I do not have a question!

After upgrading packages on one of my server, obviously Indexhibit was broken. I went to the forums to check for a newer version, there was none and there were a lot of people having problems. Well, here I am! Fixing those problems!

I am a programmer myself, but actually hate web development. It is just not my cup of soup, but my site was down and it needed to be hotfixed fast. My experience with PHP is close to nothing, but the online reference manual is a coders best friend!

ndxzstudio/index.php change line 62 to $OBJ->tunnel($OBJ->go['a'], $OBJ->go['q']);

ndxzstudio/lib/router.php change line 134 to: public function tunnel($class, $method)

Change ndxzsite/error.php to ndxzsite/cerror.php and change its class name from Error to CError. You will need to change the reference in two files ndxzstudio/module/system/index.php and ndxzstudio/common.php you can either do it manually or pass a regular expression to sed like "s/error.php/cerror.php/g". Whatever floats your boat.

And finally some minor changes to ndxzstudio/db/db.mysql.php:

Search and replace: "s/mysql_/mysqli_/g", you will find that you will need to either add $this->link to mysqli_select_db or add $indx['db'] to mysqli_connect as the last parameter.

mysqli_result($rs,0) can be changed to $rs->fetch_row()[0]

And there are a few functions that changed from mysql_ to mysqli_ which swapped parameters for example: mysql_real_escape_string($str, $this->link) became mysqli_real_escape_string($this->link, $str)

I think that was about it for the changes needed to get it going on PHP7.0.

Do not forget to check the apache error logs for anything I might have missed mocking this post up.

Maybe it would be nice if the Indexhibit repo on github was public? I could make a PR much quicker than writing this down here, which is not really faillproof either :p

Yours,

Sjoer van der Ploeg

sfjuocekr / 2016-09-18 22:08:25   

Plus if the project was public on github, I could fix most of the other problems mentioned on the forums here and make PR's!

Scanning through the issues on here, most of them are really easy to fix and the people having "issues" just post hurrdurr I have this syntax error or integer compared to boolean whatever non-errors.

So if you, after six or seven years, finally want a coderbuddy to help you out? Make the project public on github, and I'll learn myself some PHP ;)

Vaska A / 2016-09-18 22:37:32   

Yes, it's being worked on. Indexhibit is an old project - needs a ton of updates (and help).

;)

PS: I sent you an email...

matthewoliver / 2016-12-09 15:29:00   

Hello sfjuocekr,

Trying to update to php7.0 and following your instructions, I get errors on "either add $this->link to mysqli_select_db or add $indx['db'] to mysqli_connect as the last parameter"
Could you be more specific as to how we have to add it?
I get this error: mysqli_select_db() expects exactly 2 parameters, 0 given in ndxzstudio/db/db.mysql.php on line 45

Thanks!

Vaska A / 2016-12-09 16:26:04   

Those instructions aren't complete (I've talked to him about that).

I'm nearly finished with updates for PHP7 - it will be out next week.

Vaska A / 2016-12-09 21:03:54   

I'm currently running the same old Indexhibit on PHP5.4 and PHP7.0. This is looking good. It will definitely be a release next week.

I hope on Monday but there some other parts to finish.

This thread has been closed, thank you.