PHP upgrade 7.4 / 8.0

Help and support in getting the EVE-Dev Killboard to run on your site.
Post Reply
Redhouse
Apprentice
Posts: 49
Joined: Sun Mar 18, 2012 17:12

PHP upgrade 7.4 / 8.0

Post by Redhouse »

I'm having some problems with the board upgrading to 7.4 (and 8.0). I've made some changes to get 7.3 working, but at 7.4 fast cgi I get an error log of :

Code: Select all

mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Cannot pass parameter 2 by reference in /home/<USER>/<DOMAIN>/common/xajax/xajax.php:48
mod_fcgid: stderr: Stack trace:
mod_fcgid: stderr: #0 /home/<USER>/<DOMAIN>/common/includes/class.event.php(71): edk_xajax::lateProcess('')
mod_fcgid: stderr: #1 /home/<USER>/<DOMAIN>/common/index.php(237): event::call('mods_initialise...', '')
mod_fcgid: stderr: #2 /home/<USER>/<DOMAIN>/index.php(26): include('/home/<USER>/...')
mod_fcgid: stderr: #3 {main}
mod_fcgid: stderr:   thrown in /home/<USER>/<DOMAIN>/common/xajax/xajax.php on line 48
8.0 gives a similar log message.

Any help is appreciated

Redhouse
Apprentice
Posts: 49
Joined: Sun Mar 18, 2012 17:12

Re: PHP upgrade 7.4 / 8.0

Post by Redhouse »

I hacked a few pages to get the board to run on 7.4, although it's not thoroughly tested. The changes were:
get_magic_quotes functions -> remove cases, where this was used and replaced with 0/false

Functions with same name as their class -> change funtion name to '__construct' as a drop in replacement

Edited two lines out in xajax.php, which seemed to fix the problem in the previous post, and not cause new errors but I don't know why the problems existed

Code: Select all

 event::call('xajax_initialised', get_class());
 event::call('mod_xajax_initialised', get_class());
updated smarty to version 3.1.9 fixes some errors

changed /v4/corporations/{corporation_id}/ to /v5/corporations/{corporation_id}/

unrealalex
Greenhorn
Posts: 14
Joined: Wed Jan 13, 2010 18:37

Re: PHP upgrade 7.4 / 8.0

Post by unrealalex »

what changes did you make to make it work on 7.3?

Redhouse
Apprentice
Posts: 49
Joined: Sun Mar 18, 2012 17:12

Re: PHP upgrade 7.4 / 8.0

Post by Redhouse »

I got 7.4 working by using the error log for the site, and setting the site to the php version that breaks. Then I went through the log and fixed as many errors as I could followed by more investigation for the more difficult errors. For 7.3 whatever changes were required were fairly minimal so I'd suggest doing that since I didn't write down the detail on fixes for 7.3, or just implement the changes to make 7.4 work.

The changes regarding methods with the same name as their class is described here:
https://stackoverflow.com/questions/371 ... -same-name

get_magic_quotes instances probably don't matter for 7.3:
https://www.php.net/manual/en/function. ... es-gpc.php

There is an error for the each() function related to the smarty extensions, and my note was 'smarty 3.1.9 seems to work well', so you may want to update smarty files. If you download package and some files weren't used just omit them.
https://github.com/smarty-php/smarty/tree/master

The corporation ESI route is in CorporationApi.php

If you're paying for external hosting and don't want the hassle, there are probably a few services out there that will let you continue to run an old php version. I found one that appears to allow it at no additional cost here: https://www.hostinger.com/tutorials/how ... hp-version

Post Reply