[SOLVED] Error log lodger
Select messages from # through # Forum FAQ
[/[Print]\]

HeadShot Extreme -> Nuke Blocks / Modules Support

#1: No icon [SOLVED] Error log lodger Author: lasermail PostPosted: Wed Sep 19, 2018 6:57 am
    —
I have been trying in vain to track down the cause and subsequent fix for an error on my site for sometime...my Error log is spammed daily with

PHP Warning:  preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in /home/xxxxxx/public_html/includes/classes/class.identify.php on line 182

Line 182 reads preg_replace_callback($pattern, $replacement, $agent);

Can anyone suggest a suitable fix?

#2: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Wed Sep 19, 2018 12:18 pm
    —
Can you pack your file into a .zip or a .rar and attach the file you have to a post here so I can see it better. I am guessing that it's a file that lonestar pushed out for its a PHP 7.x fix.

#3: No icon Re: Error log lodger Author: lasermail PostPosted: Thu Sep 20, 2018 12:41 am
    —
As requested

#4: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Thu Sep 20, 2018 12:20 pm
    —
Okay, did you modify this file or did you download this from somewhere?

#5: No icon Re: Error log lodger Author: lasermail PostPosted: Fri Sep 21, 2018 12:32 am
    —
— coRpSE wrote
Okay, did you modify this file or did you download this from somewhere?


Must admit when I looked at it I thought, that does not look like a file lonestar edited, too old. I have not modified it as far as I know. My website is using 2.0.9d files, updated from 2.0.7 and that might too have been an update of an earlier version? I have installed a few bits and pieces since, some of them claimed fixes for errors. I might have fixed one thing to break another? My server hosts too have dabbled about on the site from time to time. Other than that I would say, when migrating thousands of files via FTP (using FileZilla and it is one of the better ones) things do not always go to plan.

If the version of class.identify.php I am using is out of date, corrupt or an unknown import, I guess I should simply obtain a new one and try it?

#6: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Fri Sep 21, 2018 9:55 am
    —
Well, it looks like that was edited for PHP7, but not correctly. What version of PHP are you using on your site? If your running PHP 5.6, then I would grab a new class.identify.php from the download and add that to your site. If your on PHP7, then I will get you a working file.

#7: No icon Re: Error log lodger Author: lasermail PostPosted: Fri Sep 21, 2018 12:27 pm
    —
— coRpSE wrote
Well, it looks like that was edited for PHP7, but not correctly. What version of PHP are you using on your site? If your running PHP 5.6, then I would grab a new class.identify.php from the download and add that to your site. If your on PHP7, then I will get you a working file.


If I check on my hosts cpanel PHP Version reads 5.6.37
If I check on Nuke Evo system info panel it reads as PHP Version 5.5.38

I will guess I am using 5.6 and at least not PHP 7 and so try the version in your download. I will update the thread with the result in due course.

#8: No icon Re: Error log lodger Author: lasermail PostPosted: Fri Sep 21, 2018 12:40 pm
    —
Okay did a quick backup of the current mystery file, installed the one in your current download instant white screen 500 error.

HP Fatal error:  Class 'DBException' not found in /home/xxxxx/public_html/includes/db/mysql.php on line 251

Restored with the backup.

CENSORED!!!

#9: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Fri Sep 21, 2018 1:39 pm
    —
That happened probably because you have several other files, possibly the public_html/includes/db/mysql.php that has been changed.
Do you happen to have the files that you uploaded and overwritten the original files?

#10: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Fri Sep 21, 2018 4:44 pm
    —
Okay, try this, make a backup of what you have now and download the attached file and give this a try. I just modified the one you sent with a pretty original function.

#11: No icon Re: Error log lodger Author: lasermail PostPosted: Sat Sep 22, 2018 2:23 am
    —
— coRpSE wrote
Okay, try this, make a backup of what you have now and download the attached file and give this a try. I just modified the one you sent with a pretty original function.


I don't have any backups of any older files. What is in situ has been running for a while now. I may have edited it in accordance with some online forum advice on an old support website (now closed), but I can't remember any specifics - I'm just guessing on that tbh.

I tried the file you prepared that gave an instant HTTP 500 error.

PHP Strict Standards:  Non-static method identify::identify_agent() should not be called statically in /home/xxxxx/public_html/mainfile.php on line 181
PHP Fatal error:  Using $this when not in object context in /home/xxxxx/public_html/includes/classes/class.identify.php on line 189

I considered taking a backup of my existing "includes" folder, replacing it with the latest folder and all contents. Then decided to wait and see if you think that might just open up another can of worms.php

hrm

#12: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 22, 2018 6:55 am
    —
Okay, can you open up your mainfile.php file and send me 5 lines before and after that line that was throwing out that error.

#13: No icon Re: Error log lodger Author: lasermail PostPosted: Sat Sep 22, 2018 7:38 am
    —
— coRpSE wrote
Okay, can you open up your mainfile.php file and send me 5 lines before and after that line that was throwing out that error.


// Include the required files
@require_once(NUKE_DB_DIR.'db.php');
//$db->debug = true;
// Include Error Logger and identify class
@require_once(NUKE_CLASSES_DIR.'class.identify.php');
global $agent;
$agent = identify::identify_agent();
@require_once(NUKE_INCLUDE_DIR.'log.php');

if (ini_get('output_buffering') && !isset($agent['bot'])) {
   ob_end_clean();
   header('Content-Encoding: none');
}

#14: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 22, 2018 8:49 am
    —
— lasermail wrote
— coRpSE wrote
Okay, can you open up your mainfile.php file and send me 5 lines before and after that line that was throwing out that error.


// Include the required files
@require_once(NUKE_DB_DIR.'db.php');
//$db->debug = true;
// Include Error Logger and identify class
@require_once(NUKE_CLASSES_DIR.'class.identify.php');
global $agent;
$agent = identify::identify_agent();
@require_once(NUKE_INCLUDE_DIR.'log.php');

if (ini_get('output_buffering') && !isset($agent['bot'])) {
   ob_end_clean();
   header('Content-Encoding: none');
}



Okay, use the class.identify.php file that I sent you before, and do this change to your mainfile.php.

Find:

PHP:  [ Select all ]

global $agent;
$agent identify::identify_agent(); 

 
Replace with:

PHP:  [ Select all ]

global $agent;

$identify = new identify();
$agent $identify->identify_agent(); 

 
You know, if you have TS3, Discord, or Skype, let me know, we can talk on there which would be faster then in here.

#15: No icon Re: Error log lodger Author: lasermail PostPosted: Sat Sep 22, 2018 9:10 am
    —
Okay tried those, HTTP 500 error with ...

PHP Strict Standards:  Non-static method identify::identify_agent() should not be called statically in /home/xxxxx/public_html/header.php on line 147
PHP Fatal error:  Using $this when not in object context in /home/xxxxx/public_html/includes/classes/class.identify.php on line 189

Sorry I know this is a long winded way of seeking your help, but I don't make use of any voice or messenger apps these days. For my part I am more than happy to keep trying things you suggest in your own time, as I can recover quickly from failures there is no urgency. I am very grateful for your efforts. Ultimately I have lived this bug spamming my error log (I clear it weekly) for some time.

#16: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 22, 2018 9:46 am
    —
Okay, well, it seems that we will be chasing down all these changes. My question to you is, how much custom coding do you have into your site ATM?

It may be best to grab all new files and upload them. You more and likely would need to chase every file basically reverting it back to the default that comes with the CMS. I don't know what files you grabbed to create this mess, I looked both on the Evo site and Lonestars site and couldn't find these changes, unless its earlier edits that someone else did years ago.

But like the edits above, you would want to follow that error into your header.php file, find the line

identify::identify_agent();

and change to

$identify->identify_agent();

You will also want to look above, that line for a "global". for example:

PHP:  [ Select all ]

global $prefix$db$name$board_config$userinfo

 
and you would want to add in a new global $identify into it, so it would look something like

PHP:  [ Select all ]

global $prefix$db$name$board_config$userinfo$identify

 
But overall, just grabbing a fresh copy of the CMS, and readding all the mods and themes you have to that might be faster and easier to do than chasing down all these errors and fixing them individually.

#17: No icon Re: Error log lodger Author: lasermail PostPosted: Sat Sep 22, 2018 10:31 am
    —
I tried that next step edit you suggested and not unexpected HTTP 500 this time with ....

PHP Warning:  preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in /home/xxxxx/public_html/includes/classes/class.identify.php on line 182
PHP Parse error:  syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /home/c426886/public_html/header.php on line 147

So I think it best we halt the piecemeal edits. I could be one more edit away, or dozens? I will do a series of backups and then install again using the version you provide. I have created some blocks, modules and numerous forum icons and images, it should be simple enough to backup, install again and recover where needed at least I assume that is the best way to use proven files over corrupt?

Thanks for giving this some of your time.

#18: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 22, 2018 11:33 am
    —
— lasermail wrote
I tried that next step edit you suggested and not unexpected HTTP 500 this time with ....

PHP Warning:  preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in /home/xxxxx/public_html/includes/classes/class.identify.php on line 182
PHP Parse error:  syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /home/c426886/public_html/header.php on line 147

So I think it best we halt the piecemeal edits. I could be one more edit away, or dozens? I will do a series of backups and then install again using the version you provide. I have created some blocks, modules and numerous forum icons and images, it should be simple enough to backup, install again and recover where needed at least I assume that is the best way to use proven files over corrupt?

Thanks for giving this some of your time.


Well, you got that error because you need to have all 3 things done. What I have been doing with you is chasing out all the bugs. You fix one, then when the next one appears, you do the next fix, and so on, but you need to have all of them in place for it to work right, You can't do one, then remove it and expect the next to work without the first fix. We were making progress.
The class.identify.php file I sent you, the mainfile.php, and the header edit all need to be done together at the same time.

But overall, Only things you need to upload is the folder includes, and maybe admin. Then the files you would want to upload from your root is the header.php, footer.php, mainfile.php, admin.php and index.php. So, ot make it more simple, just make a backup of your site, replace those files/folder(s).
Your files aren't corrupt, just, they coding is either old, or poorly updated.

#19: No icon Re: Error log lodger Author: lasermail PostPosted: Sun Sep 23, 2018 12:44 am
    —
I should probably have confirmed it for you in my post, but the HTTP 500 and errors was with all three edited files in place. I understood the need to use all three. I created a simple backup folder and upload folder to ensure uploads and any fixes went easily, I even ran it twice to be sure.

To convince myself I did not err, I repeated the 3 files test this morning..with the expected HTTP 500 result

PHP Parse error:  syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /home/xxxxx/public_html/header.php on line 147

I think where I misled you is that I copied and pasted the line 182 error in with my previous post, which is of course the error that is the root error, and so you would think he forgot to fix that, it was a call from before the test.

So to be more accurate it is now barking out this syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /home/xxxxx/public_html/header.php on line 147
which is in fact one of the lines recently edited ( $user_agent = identify->identify_agent();)

#20: No icon Re: Error log lodger Author: lasermail PostPosted: Mon Sep 24, 2018 9:51 am
    —
— coRpSE wrote
But overall, Only things you need to upload is the folder includes, and maybe admin. Then the files you would want to upload from your root is the header.php, footer.php, mainfile.php, admin.php and index.php. So, ot make it more simple, just make a backup of your site, replace those files/folder(s).Your files aren't corrupt, just, they coding is either old, or poorly updated.


Holding off doing what you have suggested above as my hosts have had some network issues. It took my site down for several hours today. So I will give it a day or two to settle, in case things take a dive again when I am mid way through trying different files etc...it would add confusion I do not need.

I prepared all backups, and updated files/folders to upload, taking into account stuff I added recently such as Honeypot.

I will update this thread in the next few days to hopefully to give it closure. Someone else might have a similar issue one day?

#21: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Sep 24, 2018 12:17 pm
    —
okay.

#22: No icon Re: Error log lodger Author: lasermail PostPosted: Wed Sep 26, 2018 4:19 am
    —
— coRpSE wrote
okay.


Apologies this is long winded, but concise. It is progress, but not fully sorted.

1. This morning I uploaded a total of 1702 files via FTP, strictly in accordance with your instruction, that is to say the full folders and .php files you suggested. Immediately the site remained up, no more HTTP 500 and the original error that had been a lodger on my site for too long finally gone. To be replaced with this error UTC] PHP Strict Standards:  Non-static method identify::get_ip() should not be called statically in /home/XXXX/public_html/modules/Forums/common.php on line 235 So I compared my current common.php with the one in your latest version, they differed enough (the -> again) for me to decide to just swap them out.Success, this new error gone.

2. Things remained stable until I logged in as Admin on the site, my admin screen blank with 2 entries in the PHP error log telling me
PHP Strict Standards:  Non-static method identify::identify_agent() should not be called statically in /home/xxxx/public_html/blocks/block-CZUser-Info.php on line 262
and
PHP Fatal error:  Using $this when not in object context in /home/xxxx/public_html/includes/classes/class.identify.php on line 195

I swapped out the block-CZUser-Info.php as it looked like another case of :: instead of -> in the $user_agent = $identify->identify_agent();
I did nothing with the class.identify.php, because that has just been added. The PHP error log cleared again.

3. I then tried to use Quick navigation to Admin(Nuke-Evo) I now get a white screen with ....

Uncaught Exception Has Occurred! Message: An error occurred while attempting to run a query on the database!
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Server Bans'' at line 1

File: /home/xxxx/public_html/includes/db/mysql.php
Line: 251
Stack Trace:
#5{main}
#4/home/xxxx/public_html/admin.php(368): adminMain()
#3/home/xxxx/public_html/admin/modules/index.php(65): GraphicAdmin()
#2/home/xxxx/public_html/admin/functions.php(481): is_mod_admin('~l~xxxx Serve...')
#1/home/xxxx/public_html/includes/functions_evo.php(108): sql_db->sql_ufetchrow('SELECT admins F...', 2)
#0/home/xxxx/public_html/includes/db/mysql.php(743): sql_db->sql_query('SELECT admins F...', true)    


I am not inclined to regress using backups, not yet at least, because I think this is getting closer to a full resolution. The site is otherwise running and accessible, to forum users, it's just sorting my Nuke Evo Admin status. I can access forum admin and blocks etc other areas. But the Nuke Evo screen is a dud. I don't want to jump in from here and start swapping more files or second guessing what this needs, until you have had a chance to review the above error, and can suggest what you would be doing next.

Thanks

#23: No icon Re: Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Wed Sep 26, 2018 12:02 pm
    —
I replied to your PM.

#24: No icon Re: [SOLVED] Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Wed Sep 26, 2018 6:53 pm
    —
Okay, here is an update. His site has been solved. I don't know if previously he was running a older version of the CMS, or added some bad files from a "update" patch, but they were wrong. He installed fresh files from a new download and it worked, except for his admin which turned out to be some bad links placed into the "Modules Block EDIT", (for the navigation he was using). I removed those links and everything worked fine. I did suggest to him to use Sommaire which is what is used on this site instead, and it is preinstalled with the CMS so it's worth using.

Link to the tutorial is here:
Please login to see this link
Get registered or Log in

#25: No icon Re: [SOLVED] Error log lodger Author: lasermail PostPosted: Thu Sep 27, 2018 2:02 am
    —
— coRpSE wrote
Okay, here is an update. His site has been solved. I don't know if previously he was running a older version of the CMS, or added some bad files from a "update" patch, but they were wrong. He installed fresh files from a new download and it worked, except for his admin which turned out to be some bad links placed into the "Modules Block EDIT", (for the navigation he was using). I removed those links and everything worked fine. I did suggest to him to use Sommaire which is what is used on this site instead, and it is preinstalled with the CMS so it's worth using.

Link to the tutorial is here:
Please login to see this link
Get registered or Log in


...and very much appreciated has been your skilled understanding, advice and daily replies.

I have been running game servers over 15 years and some years back created a Nuke Evo website. As a Nuke Evo user I would teach myself some basics, get things to work then let sleeping dogs lie. I rarely made many changes once the site worked and suited its purpose. However I have been forced to recover from serious mess ups by my web hosting company three or four times over the years (they wiped a lot of forum history and forum members). Likely each time I thought I was recovering things were actually getting more out of tune. So one error, compounded another and so on. I think this is the first time I found a really reliable source of working files and people able to offer valid help. Over the years there have been several websites claiming to support the Nuke Evo community, but these appear to have shrunk in number considerably of late - many people have moved to use other things - not all look that convincing imo.  

Ultimately it has taken a person with valid and up to date knowledge to recognise the exact nature of the problems on my website, and then finally step in with the hands on fixes.

THANK YOU VERY MUCH.

#26: No icon Re: [SOLVED] Error log lodger Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Thu Sep 27, 2018 1:59 pm
    —
It's no problem. I am still over at
Please login to see this link
Get registered or Log in
answering questions, and
Please login to see this link
Get registered or Log in
. Both Lonestar and I are frequently. I go there daily and I know Lonestar visits pretty much daily as well.



HeadShot Extreme -> Nuke Blocks / Modules Support


output generated using printer-friendly topic mod. All times are GMT - 7 Hours

Page 1 of 1