DragonPrime - LoGD Resource Community

Game Administration, Installation and Configuration => Installation and Configuration Assistance => Topic started by: ChesireCat on April 07, 2018, 10:19:48 AM



Title: Installing error on 1.0.6
Post by: ChesireCat on April 07, 2018, 10:19:48 AM
Fatal error: Uncaught Error: Call to undefined function mysqli_proc_connect() in /home/vhosts/crystaltales.eu5.org/lib/dbwrapper.php:144 Stack trace: #0 /home/vhosts/crystaltales.eu5.org/common.php(124): db_connect(NULL, NULL, NULL) #1 /home/vhosts/crystaltales.eu5.org/installer.php(13): require_once('/home/vhosts/cr...') #2 {main} thrown in /home/vhosts/crystaltales.eu5.org/lib/dbwrapper.php on line 144

Hello, there first of all i know that i shouldn't even be installing an older unsuported version of the game, but the wizards/editors i wanna use don't seem compatible with the newest version of lotgd, i would like to request some help fixing the instalation errors, if anyone would be so kind to help me T.T


Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 07, 2018, 08:29:01 PM
Fatal error: Uncaught Error: Call to undefined function mysqli_proc_connect() in /home/vhosts/crystaltales.eu5.org/lib/dbwrapper.php:144 Stack trace: #0 /home/vhosts/crystaltales.eu5.org/common.php(124): db_connect(NULL, NULL, NULL) #1 /home/vhosts/crystaltales.eu5.org/installer.php(13): require_once('/home/vhosts/cr...') #2 {main} thrown in /home/vhosts/crystaltales.eu5.org/lib/dbwrapper.php on line 144

Hello, there first of all i know that i shouldn't even be installing an older unsuported version of the game, but the wizards/editors i wanna use don't seem compatible with the newest version of lotgd, i would like to request some help fixing the instalation errors, if anyone would be so kind to help me T.T

OK...let me ask a few questions I know are gonna get asked that may help to help you?

1. What version of PHP are you using, and what version of MySQL?  You should find this in the Control Panel on your server.

2. What step in the install process do you have this problem?

3. did you upload a database to your server before you started the install?  It is my understanding you must first upload a database, even a rudimentary one.

4. do you have a file on your server called db_connect.php?  If so, delete it and re-run the install.  The install should create this file FOR YOU...so you don't want it there when you start the install (this usually hangs you up like on Step 8 if I recall it correctly)

At some point along later versions of PHP I know that the Mysql_Connect needs to be changed to db_connect (I am sure I have seen this floating around here somewhere) - so it's helpful to peoplke if it is known what version of PHP your server is running.

That should get some help started, if you can answer these questions.


Title: Re: Installing error on 1.0.6
Post by: Aeolus on April 07, 2018, 09:11:42 PM
Hello, there first of all i know that i shouldn't even be installing an older unsuported version of the game, but the wizards/editors i wanna use don't seem compatible with the newest version of lotgd, i would like to request some help fixing the instalation errors, if anyone would be so kind to help me T.T

"Unsupported" typically means that yes, it's unsupported and there's little help for it.

What editors won't work with it? I recommend using the updated code, and then adapting those editors to work with it. It's better to use the correct system and make a few small changes, then to use an outdated system that is weak on its security just so a module or two will work.


Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 08, 2018, 06:53:19 AM
Agreeing with you, Aeolus, but if Cheshire really does want, for whatever reason, to do 1.0.6 - I am guessing the problem could be a function that was changed in higher versions of PHP

What jumped at me is this:

mysqli_proc_connect(

Because if you do a Google search on that, it does not even come up.  

What does come back is mysqli_real_connect(

or just

mysqli_connect(

I know I had trouble, a while back, with my 1.1.0 live site...when my server vendor upgraded my version of PHP without telling me and sure enough it broke things and I had to fix them.

I am still actively working on my 1.1.2 test server, literally testing everything to the breaking point, to make sure everything works as I want before converting my live site to 1.1.2

I'm still not even certain I can import the 1.1.0 database over, so that players don't have to start over when I do a conversion...so I am also seeing what I ca accumulate in a given number of kills, so I can start experienced players out with some kind of bonus stuff if the database from the old site won't go to the new site.


Title: Re: Installing error on 1.0.6
Post by: Aeolus on April 08, 2018, 07:08:13 AM
Then use 1.0.6 on a test server. Use 1.1.2+Updates on the live server.


Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 08, 2018, 07:17:57 AM
Then use 1.0.6 on a test server. Use 1.1.2+Updates on the live server.

I'm working on it!!!

My live site will go 1.1.2 - just a matter of resolving a few things...like I may be changing hosts...and if I do, may as well start fresh with the 1.1.2 on a new host...just need to figure if I can transfer in the old database or not.

Everything I have going on now, on the 1.1.2 test server functions correctly, I am working more on aesthetics and a few features.

Also testing out something on my live site, which I will need to release here once it fully tests...I created a new Specialty, based on the other "Mana" Specialties.  But first I have to ring it all the way up to make sure everything works like it is supposed to.  Because it is based on the original Mana Specialties by Aelia, I will need to release it once it all tests out...and with proper author crediting.


Title: Re: Installing error on 1.0.6
Post by: Aeolus on April 08, 2018, 07:22:33 AM
I was actually talking about/to ChesireCat and their site.

Yes, you can transfer in the old database. Export the current database through whatever backup method you use, import it into the new host's database.


Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 08, 2018, 07:32:45 AM
I was actually talking about/to ChesireCat and their site.

Yes, you can transfer in the old database. Export the current database through whatever backup method you use, import it into the new host's database.

I know that.  What I am NOT sure of...is if the old 1.1.0 database will work with some of the new 1.1.2 stuff.  For example, 1.1.0 does not have AI for forest creatures, and 1.1.2 does...would the old table work and the install add the appropriate column?

That is the sort of thing I do not know.


Title: Re: Installing error on 1.0.6
Post by: Brendan on April 08, 2018, 08:41:45 AM
You should never mix the install with the database. If your using 1.1.0 then use the 1.1.0 database, if your using 1.1.2 use the 1.1.2 database. Otherwise you will find yourself running into a lot of problems.


Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 08, 2018, 08:52:46 AM
You should never mix the install with the database. If your using 1.1.0 then use the 1.1.0 database, if your using 1.1.2 use the 1.1.2 database. Otherwise you will find yourself running into a lot of problems.

That was what I thought.

Thus...I will NOT be able to save my players' stuff in an upgrade to 1.1.2 - will I?


Title: Re: Installing error on 1.0.6
Post by: Talisman on April 08, 2018, 10:56:46 AM
You should never mix the install with the database. If your using 1.1.0 then use the 1.1.0 database, if your using 1.1.2 use the 1.1.2 database. Otherwise you will find yourself running into a lot of problems.

That was what I thought.

Thus...I will NOT be able to save my players' stuff in an upgrade to 1.1.2 - will I?

You could, with work.  Using a test server to develop the process of course, you'll need to determine what fields are missing altogether and/or missing the old data and create a custom db query to pull that information from the 1.1.0 db then update the 1.1.2 db. 


Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 08, 2018, 04:42:57 PM
You should never mix the install with the database. If your using 1.1.0 then use the 1.1.0 database, if your using 1.1.2 use the 1.1.2 database. Otherwise you will find yourself running into a lot of problems.

That was what I thought.

Thus...I will NOT be able to save my players' stuff in an upgrade to 1.1.2 - will I?

You could, with work.  Using a test server to develop the process of course, you'll need to determine what fields are missing altogether and/or missing the old data and create a custom db query to pull that information from the 1.1.0 db then update the 1.1.2 db. 

OK, not sure how you do this.

Just as an example...on my 1.1.2 test server, I imported my 1.1.0 creatures database - this is how I found out about the missing AI column, because now, on my test server, I can't add creatures through the Creature editor, I literally have to manually add them thru PHP My Admin.

So...one mistake I will not do when I go live with 1.1.2 is to do what I did on the test server, LOL


Title: Re: Installing error on 1.0.6
Post by: ChesireCat on April 09, 2018, 05:56:48 PM
Quote
"Unsupported" typically means that yes, it's unsupported and there's little help for it.

What editors won't work with it? I recommend using the updated code, and then adapting those editors to work with it. It's better to use the correct system and make a few small changes, then to use an outdated system that is weak on its security just so a module or two will work.

Completely understand your point aeolus, but due to my limited(non existent) coding skills i do rely on modules and wizards to be able to convert my ideas into aplicable game ideas, the module in question are mana specialties by thanatos, although aelias specialties are quite superior mechanical wise they are also much more complex and harder to customise what i'm aiming for is  a good illuison of specialty mastery or progress , while looking around through the threads i read something about the modules who create DB tables, seem to conflict a bit on 1.1.2, so i tried to install 1.0.6 wich i remember worked with it flawlessly a few years ago


Quote
OK...let me ask a few questions I know are gonna get asked that may help to help you?

1. What version of PHP are you using, and what version of MySQL?  You should find this in the Control Panel on your server.

2. What step in the install process do you have this problem?

3. did you upload a database to your server before you started the install?  It is my understanding you must first upload a database, even a rudimentary one.

4. do you have a file on your server called db_connect.php?  If so, delete it and re-run the install.  The install should create this file FOR YOU...so you don't want it there when you start the install (this usually hangs you up like on Step 8 if I recall it correctly)

At some point along later versions of PHP I know that the Mysql_Connect needs to be changed to db_connect (I am sure I have seen this floating around here somewhere) - so it's helpful to peoplke if it is known what version of PHP your server is running.

1- PHP 7.1,
database server to MariaDB 10.2
and apache to version 2.4.

2-Straight of the bat once i click game installer that error pops out

3-Did not upload any db, created one from scratch for the server test

4-Answer number 3




Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 09, 2018, 09:44:52 PM
Quote
"Unsupported" typically means that yes, it's unsupported and there's little help for it.

What editors won't work with it? I recommend using the updated code, and then adapting those editors to work with it. It's better to use the correct system and make a few small changes, then to use an outdated system that is weak on its security just so a module or two will work.

Completely understand your point aeolus, but due to my limited(non existent) coding skills i do rely on modules and wizards to be able to convert my ideas into aplicable game ideas, the module in question are mana specialties by thanatos, although aelias specialties are quite superior mechanical wise they are also much more complex and harder to customise what i'm aiming for is  a good illuison of specialty mastery or progress , while looking around through the threads i read something about the modules who create DB tables, seem to conflict a bit on 1.1.2, so i tried to install 1.0.6 wich i remember worked with it flawlessly a few years ago


Quote
OK...let me ask a few questions I know are gonna get asked that may help to help you?

1. What version of PHP are you using, and what version of MySQL?  You should find this in the Control Panel on your server.

2. What step in the install process do you have this problem?

3. did you upload a database to your server before you started the install?  It is my understanding you must first upload a database, even a rudimentary one.

4. do you have a file on your server called db_connect.php?  If so, delete it and re-run the install.  The install should create this file FOR YOU...so you don't want it there when you start the install (this usually hangs you up like on Step 8 if I recall it correctly)

At some point along later versions of PHP I know that the Mysql_Connect needs to be changed to db_connect (I am sure I have seen this floating around here somewhere) - so it's helpful to peoplke if it is known what version of PHP your server is running.

1- PHP 7.1,
database server to MariaDB 10.2
and apache to version 2.4.

2-Straight of the bat once i click game installer that error pops out

3-Did not upload any db, created one from scratch for the server test

4-Answer number 3




Well, I see part of your problem already.  PHP 7.1
My understanding is that LOTGD as it is currently (even version 1.1.2) WILL NOT WORK with PHP 7.

Mainly, I think because of a number of functions that have been degraded in later versions of PHP.

I think this is where the mysqli_connect thing is gonna come up...let me look around and see if I can find what I was referencing.


YESSSSS...here it is, and our friend Aeolus wrote it...

Replace all mysql_ functions with db_ in the dbwrapper files.

Here is the thread reference: http://dragonprime.net/index.php?topic=12866.0

Notice they were having the same problem with PHP 7.

I knew this was floating out there somewhere, which is why I asked you the questions I did at the top of this thread.

Try Aeolus' solution there, replace the mysql_ functions with db_ in the dbwrapper file.


Title: Re: Installing error on 1.0.6
Post by: Aeolus on April 09, 2018, 09:54:35 PM
My understanding is that LOTGD as it is currently (even version 1.1.2) WILL NOT WORK with PHP 7.

Where did you get that? Fandom Kingdom is running PHP 7.0.28 perfectly.


Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 09, 2018, 11:59:58 PM
My understanding is that LOTGD as it is currently (even version 1.1.2) WILL NOT WORK with PHP 7.

Where did you get that? Fandom Kingdom is running PHP 7.0.28 perfectly.

See the thread I referenced.  That is where I got it.  Hence, my saying - it is my understanding...

Apparently, it DOES work, with the fix you yourself wrote about in that thread.  But AS IT IS...apparently it doesn't work with PHP 7...my understanding, which may well be incorrect.


Title: Re: Installing error on 1.0.6
Post by: Aeolus on April 10, 2018, 12:19:33 AM
Apparently, it DOES work, with the fix you yourself wrote about in that thread.  But AS IT IS...apparently it doesn't work with PHP 7...my understanding, which may well be incorrect.

Gotcha. Then it just needs to be fixed in the Updates Fixed version (as it was reported after that version was uploaded) by someone who can upload/update those files.


Title: Re: Installing error on 1.0.6
Post by: TGTarheel on April 10, 2018, 12:36:16 AM
Apparently, it DOES work, with the fix you yourself wrote about in that thread.  But AS IT IS...apparently it doesn't work with PHP 7...my understanding, which may well be incorrect.

Gotcha. Then it just needs to be fixed in the Updates Fixed version (as it was reported after that version was uploaded) by someone who can upload/update those files.

No problem!!  Hee hee...

See I am learning a few things, LOL


Title: Re: Installing error on 1.0.6
Post by: ChesireCat on April 10, 2018, 01:47:51 PM
Sorry for the double post but
where would i get the said mysql_functions
Code:
<?php
// addnews ready
// translator ready
// mail ready
require_once("lib/errorhandling.php");
require_once(
"lib/datacache.php");

define('DBTYPE',"mysqli_proc");

$dbinfo = array();
$dbinfo['queriesthishit']=0;

function 
db_query($sql$die=true){
 
if (defined("DB_NODB") && !defined("LINK")) return array();
global $session,$dbinfo;
$dbinfo['queriesthishit']++;
$fname DBTYPE."_query";
$starttime getmicrotime();
$r $fname($sql);

if (!$r && $die === true) {
  if (defined("IS_INSTALLER")){
  return array();
}else{
if ($session['user']['superuser'] & SU_DEVELOPER || 1){
require_once("lib/show_backtrace.php");
die(
"<pre>".HTMLEntities($sql)."</pre>"
.db_error(LINK)
.show_backtrace()
);
}else{
die("A most bogus error has occurred.  I apologise, but the page you were trying to access is broken.  Please use your browser's back button and try again.");
}
}
}
$endtime getmicrotime();
if ($endtime $starttime >= 0.25 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT)){
$s trim($sql);
if (strlen($s) > 800$s substr($s,0,400)." ... ".substr($s,strlen($s)-400);
debug("Slow Query (".round($endtime-$starttime,2)."s): ".(HTMLEntities($s))."`n");
}
unset($dbinfo['affected_rows']);
$dbinfo['affected_rows']=db_affected_rows();
return $r;
}

//& at the start returns a reference to the data array.
//since it's possible this array is large, we'll save ourselves
//the overhead of duplicating the array, then destroying the old
//one by returning a reference instead.
function &db_query_cached($sql,$name,$duration=60){
//this function takes advantage of the data caching library to make
//all of the other db_functions act just like MySQL queries but rely
//instead on disk cached data.
//if (getsetting("usedatacache", 0) == 1) debug("DataCache: $name");
global $dbinfo;
$data datacache($name,$duration);
if (is_array($data)){
reset($data);
$dbinfo['affected_rows']=-1;
return $data;
}else{
$result db_query($sql);
$data = array();
for ($i=0;$i<db_num_rows($result);$i++){
$data[$i] = db_fetch_assoc($result);
}
updatedatacache($name,$data);
reset($data);
return $data;
}
}

if (
file_exists("lib/dbremote.php")) {
require_once("lib/dbremote.php");
}

function 
db_error($link=false){
$fname DBTYPE."_error";
if ($link!==false)
$r = @$fname($link);
else
$r = @$fname();
 
if ($r=="" && defined("DB_NODB")) return "The database connection was never established";
return $r;
}

function 
db_fetch_assoc(&$result){
if (is_array($result)){
//cached data
if (list($key,$val)=each($result))
return $val;
else
return false;
}else{
$fname DBTYPE."_fetch_assoc";
$r $fname($result);
return $r;
}
}

function 
db_insert_id(){
 
if (defined("DB_NODB") && !defined("LINK")) return -1;
$fname DBTYPE."_insert_id";
$r $fname();
return $r;
}

function 
db_num_rows($result){
if (is_array($result)){
return count($result);
}else{
  if (defined("DB_NODB") && !defined("LINK")) return 0;
$fname DBTYPE."_num_rows";
$r = @$fname($result); //Whyfor turn off error reporting here?
return $r;
}
}

function 
db_affected_rows($link=false){
global $dbinfo;
if (isset($dbinfo['affected_rows'])) {
return $dbinfo['affected_rows'];
}
 
if (defined("DB_NODB") && !defined("LINK")) return 0;
$fname DBTYPE."_affected_rows";
if ($link===false) {
$r $fname();
}else{
$r $fname($link);
}
return $r;
}

function 
db_pconnect($host,$user,$pass){
$fname DBTYPE."_pconnect";
$r $fname($host,$user,$pass);
return $r;
}

function 
db_connect($host,$user,$pass){
$fname DBTYPE."_connect";
$r $fname($host,$user,$pass);
return $r;
}

function 
db_get_server_version()
{
$fname DBTYPE."_get_server_info";
$r $fname();
return $r;
}

function 
db_select_db($dbname){
$fname DBTYPE."_select_db";
$r $fname($dbname);
return $r;
}
function 
db_free_result($result){
if (is_array($result)){
//cached data
unset($result);
}else{
  if (defined("DB_NODB") && !defined("LINK")) return false;
$fname DBTYPE."_free_result";
$r $fname($result);
return $r;
}
}

function 
db_table_exists($tablename){
 
if (defined("DB_NODB") && !defined("LINK")) return false;
$fname DBTYPE."_query";
$exists $fname("SELECT 1 FROM `$tablename` LIMIT 0");
if ($exists) return true;
return false;
}

function 
db_prefix($tablename$force=false) {
global $DB_PREFIX;

if ($force === false) {
$special_prefixes = array();

// The following file should be used to override or modify the
// special_prefixes array to be correct for your site.  Do NOT
// do this unles you know EXACTLY what this means to you, your
// game, your county, your state, your nation, your planet and
// your universe!
if (file_exists("prefixes.php")) require_once("prefixes.php");

$prefix $DB_PREFIX;
if (isset($special_prefixes[$tablename])) {
$prefix $special_prefixes[$tablename];
}
} else {
$prefix $force;
}
return $prefix $tablename;
}
?>

© 2018 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines