DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • November 20, 2017, 02:57:14 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: HELP!! PHP 5.5  (Read 231 times)
0 Members and 1 Guest are viewing this topic.
TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 169


View Profile
« on: October 29, 2017, 06:40:33 AM »

My darn server company upped me without telling me and now I have a fatal error...

[29-Oct-2017 13:06:44 UTC] PHP Fatal error: Call to undefined function session_register() in /home/xxx-redacted-xxx/public_html/common.php on line 87

This means that function in question is no longer supported starting from PHP 5.4, while minor available PHP version is 5.5.


How do I fix this??

I found an "answer" on Google...

$_SESSION['myusername']="something";

But what do I put in the "something" parts??
What do I put in 'myuserame' or does that stay the same??

UPDATE:  Looked into the core code for Version 1.1.1 and Version 1.1.2 - I currently run 1.1.0
Both Version 1.1.1 and Version 1.1.2 contain the same offending line at or near line 87 in common.php

So a core upgrade will not fix my problem.

« Last Edit: October 29, 2017, 08:01:01 AM by TGTarheel » Logged
TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 169


View Profile
« Reply #1 on: October 29, 2017, 08:21:11 AM »

OK, might have just solved my own problem...

Code:
session_start();
function session_register($name){
    if(isset($GLOBALS[$name])) $_SESSION[$name] = $GLOBALS[$name];
    $GLOBALS[$name] = &$_SESSION[$name];
}

//session_register("session");
$session =& $_SESSION['session'];

replaced


Code:
session_register("session");
$session =& $_SESSION['session'];

in common.php

I am in my site now where I could not log in before.

Now the test of time to make sure nothing else got broken.


Some other peeps might make use of this little fix....since Versions 1.1.1 and 1.1.2 BOTH contain the offending line at or near line 87 in common.php


I will update later if anything else breaks because of this.

UPDATE: So far nothing else I can see has broken.
« Last Edit: October 29, 2017, 09:56:36 AM by TGTarheel » Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5477



View Profile WWW
« Reply #2 on: October 29, 2017, 12:05:12 PM »

Take a look at this version of 1.1.2 which has numerous bugfixes applied to overcome the challenges posed by newer versions of php.  You may find the fixes you need.

Link helps:  http://dragonprime.net/index.php?module=Downloads;sa=dlview;id=1457
« Last Edit: October 29, 2017, 08:37:50 PM by Talisman » Logged

Play the latest beta version here on DragonPrime
Stephen.Kise
Codemeister
****
Offline Offline

Posts: 377


So meme'd up.


View Profile
« Reply #3 on: October 29, 2017, 02:53:06 PM »

This is a great reason to keep your stuff upgraded.
Logged

Slowly progressing fork with PHP 7 support: https://github.com/stephenKise/Legend-of-the-Green-Dragon
Cheap VPS Hosting (10$ credit!): https://m.do.co/c/acde75b086c5
Aeolus
Mod God
*****
Offline Offline

Posts: 1792


You're welcome.


View Profile WWW
« Reply #4 on: October 29, 2017, 04:18:37 PM »

Some other peeps might make use of this little fix....since Versions 1.1.1 and 1.1.2 BOTH contain the offending line at or near line 87 in common.php

The current upload of 1.1.2 doesn't, because we went through and fixed those bugs, such as those listed here.
Logged

Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5477



View Profile WWW
« Reply #5 on: October 29, 2017, 08:38:32 PM »

Some other peeps might make use of this little fix....since Versions 1.1.1 and 1.1.2 BOTH contain the offending line at or near line 87 in common.php

The current upload of 1.1.2 doesn't, because we went through and fixed those bugs, such as those listed here.

Also available in Dragonprime's downloads...I forgot to include the link in my earlier post:  http://dragonprime.net/index.php?module=Downloads;sa=dlview;id=1457
Logged

Play the latest beta version here on DragonPrime
TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 169


View Profile
« Reply #6 on: October 30, 2017, 02:02:35 PM »

Need to look into this stuff.

I got a call stack problem with creaturedrop now...apparently...

Code:
debug($drop['name']);
ths is on line 41 of creaturedrop.php and seems to be causing a call stack, listed below:


PHP Warning: "Illegal string offset 'name'"
in /home/savmor/public_html/modules/creaturedrop.php at 41.
Call Stack:
2: creaturedrop_dohook("battle-victory", Array(
"creatureid"=>"333", "creaturename"=>"Deadly Master Dragon Symp...", "creaturelevel"=>"7", "creatureweapon"=>"Razor Sharp Dagger", "creaturelose"=>"I will be avenged. You ha...", "creaturewin"=>NULL, "creaturegold"=>423, "creatureexp"=>129, "creaturehealth"=>-4, "creatureattack"=>24, "creaturedefense"=>15, "oldcreatureexp"=>NULL, "createdby"=>"DaveS", "forest"=>"1", "graveyard"=>"0", "playerstarthp"=>"169", "diddamage"=>0, "type"=>"forest", "didsurprise"=>1, "fightoutput"=>"<!-- AllowAnonymous: Fals..."
)) called from /home/savmor/public_html/lib/modules.php on line 512
3: modulehook("battle-victory", Array(
"creatureid"=>"333", "creaturename"=>"Deadly Master Dragon Symp...", "creaturelevel"=>"7", "creatureweapon"=>"Razor Sharp Dagger", "creaturelose"=>"I will be avenged. You ha...", "creaturewin"=>NULL, "creaturegold"=>423, "creatureexp"=>129, "creaturehealth"=>-4, "creatureattack"=>24, "creaturedefense"=>15, "oldcreatureexp"=>NULL, "createdby"=>"DaveS", "forest"=>"1", "graveyard"=>"0", "playerstarthp"=>"169", "diddamage"=>0, "type"=>"forest", "didsurprise"=>1, "fightoutput"=>"<!-- AllowAnonymous: Fals..."
)) called from /home/savmor/public_html/battle.php on line 277
4: require_once("/home/savmor/public_html/...") called from /home/savmor/public_html/forest.php on line 188

For now, i just commented out line 41 to see what happens, is there a known fix?


UDATE:  Further investigation is telling me that the fuction s expectng an array and it is getting a strng.

Does that seem right?

If so...what code can I use above the call....too explode it into an array instead f a string?

And then, should I implode it back into a string or leave it an array?
« Last Edit: October 30, 2017, 03:00:08 PM by TGTarheel » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
19 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search