Official Soldat Forums
Soldat Fans => Fan Apps => Topic started by: HEX on June 18, 2009, 02:11:20 pm
-
Hey guys, I'm getting some errors while trying to install Zitro Stats.
Here is the error:
<b>Warning</b>: Invalid argument supplied for foreach() in <b>C:\xampp\htdocs\zitro\include\update_sync.inc.php</b> on line <b>91</b><br />
Here is the complete update.php
____ _ ____ __ __
[__ ] |_ __] \/ \ Stats - Version 1.20080821
/ /| || || O )O | ---------------------------
/ /_| || || < | (C)2008-08-21 Stefan Schulz
[____]_||_||_|\_\__/ o_zilla@hotmail.com
http://zitrostats.sourceforge.net/
==[ SYNCHRONIZE ]====================================
server 1 (189.1.174.10:23102) tNt
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>C:\xampp\htdocs\zitro\include\update_sync.inc.php</b> on line <b>91</b><br />
log files: 0 total, 0 changed, 0 new
==[ CLEAN EXPIRED ]==================================
expiredate: 2009-03-19 10:09:27
events before deadline: 0
==[ CALCULATING NEW ]================================
parsing new events from 0 log(s)
==[ UPDATE DATABASE ]================================
insert new done
delete old done
==[ PLUGINS ]========================================
ERROR: opendir failed!
The logdir is configured like this: ftp://login:password@189.1.174.10/189.1.174.10%20port%2023102/logs/
I can access it through the browser... but seems that zitro stats doesn't access.
In soldat.ini Logging and Allow_Download are set to 1.
What can it be?
-
Wrong section.
-
What's the right one then?
-
Try running your ftp at default port 21 and remove the "port" thing. So it looks like:
ftp://login:password@189.1.174.10/logs/
*If "23102" is an ftp folder then your path should look like this:
ftp://login:password@189.1.174.10/23102/logs/
-
Leo, the ftp server runs at port 21.
The name of the folder is "189.1.174.10 port 23102" without quotes
-
For future reference, and it case Hex won't end up seeing my PM on IRC:
Open up include\update_sync.inc.php.
Replace
$list = ftp_rawlist($ftp,'.');
with
$list = ftp_rawlist($ftp, urldecode($reg[5]).'kills');
And see if that helps.
EDIT: Sorry, that won't work because Hex's provider is using some... very weird FTP server.
Instead, do this:
Replace
$list = ftp_rawlist($ftp,'.');
foreach($list as $line) {
if(preg_match('/^-r[w-][x-]r[w-][x-]r[w-][x-]\s+\d+\s+\S+\s+\S+\s+(\d+)\s\S+\s+\d+\s+\d+:\d+\s(.*)$/',$line,$line,0) && $line[1]>0)
$new[$line[2]] = $line[1];
}
with
$list = ftp_rawlist($ftp, urldecode($reg[5]).'kills');
foreach($list as $line) {
if(preg_match('/^.* (\d+) (.*)$/',$line,$line,0) && $line[1]>0)
$new[$line[2]] = $line[1];
}
-
Wow, that's so awesome. Thanks Toumaz, really!
-
Hey, now I am getting these error:
*********************************************************
[__ ] |_ __] \/ \ Stats - Version 1.20080821
/ /| || || O )O | ---------------------------
/ /_| || || < | (C)2008-08-21 Stefan Schulz
[____]_||_||_|\_\__/ o_zilla@hotmail.com
http://zitrostats.sourceforge.net/
==[ SYNCHRONIZE ]====================================
server 1 (189.1.174.20:23102) =tNt=
log files: 55 total, 0 changed, 1 new
ERROR: touch for KillLog-09-06-19-03.txt failed!
==[ CLEAN EXPIRED ]==================================
expiredate: 2009-03-20 05:11:25
events before deadline: 0
==[ CALCULATING NEW ]================================
parsing new events from 0 log(s)
==[ UPDATE DATABASE ]================================
insert new done
delete old done
==[ PLUGINS ]========================================
ERROR: opendir failed!
*********************************************************
I could update only 1 time. Now I get that...
-
EDIT:
17:37 <Toumaz> hex`: if you've haven't tried that code i gave you already, don't
17:37 <Toumaz> it won't work
17:37 <Toumaz> mostly because i'm stupid like an idiot
I'm not entirely certain this solution will work; open up the very same include\update_sync.inc.php again.
Replace
$temp = "temp/ftp-${server}-${log}";
if(!$offset) @unlink($temp);
if(!@touch($temp)) {
fecho(" ERROR: touch for $log failed!\n");
continue;
}
fecho(" caching $log");
if(!@ftp_get($ftp,$temp,$log,FTP_BINARY,$offset)) {
fecho("\n ERROR: ftp_get for $log failed!\n");
continue;
}
with
$temp = "temp/ftp-${server}-${log}";
if(!$offset) @unlink($temp);
fecho(" caching $log");
if(!@ftp_get($ftp,$temp,$log,FTP_BINARY,$offset)) {
fecho("\n ERROR: ftp_get for $log failed!\n");
continue;
}
if(!@ftp_put($ftp, $log, $temp, FTP_BINARY)) {
fecho(" ERROR: manual reupload for $log failed!\n");
continue;
}
It's not very efficient, it's a rather dirty solution on the whole, but hopefully it'll act as a workaround. If it doesn't seem to work regardless (wouldn't surprise me), gimme a poke in #soldat.devs and I'll try to assist you further.
And if possible, you might want to have a word with your hosting provider to see if they can somehow get a better FTP daemon running than whatever they're using now.
-
Are you sure the folders temp/ and plugins/ both exist and the webserver user has write permissions to them?
-
Yes I am.
Maybe this will help: if I try access update.php locally (localhost), it updates. If I try to access the external update.php, I get that error.
I modified to 777 and now it works. Thanks to jrgp and Toumaz (again)!