SA-MP Forums Archive
Error in sa-mp-status.php - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error in sa-mp-status.php (/showthread.php?tid=70048)



Error in sa-mp-status.php - djdanni - 22.03.2009

hi i have sa-mp-status.php and i am getting this error.
Код:
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/gtasais/public_html/sa-mp-status.php on line 40

Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/gtasais/public_html/sa-mp-status.php on line 42

Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/gtasais/public_html/sa-mp-status.php on line 44
And here is my sa-mp-status.php in Pastebin
http://pastebin.com/f7d421d0c
Any idear wuy this is happining?


Re: Error in sa-mp-status.php - djdanni - 22.03.2009

Somone?


Re: Error in sa-mp-status.php - Delused - 22.03.2009

Your server is offline or isn't port forwarded.

You need to add
Код:
	$conInfo=stream_get_meta_data($fp);
	if($conInfo['timed_out']){
		exit("Server Offline");
	}
before $is_passworded.

The '$length' parameter in fread has to be bigger than zero.
Since your server is offline it doesn't receive a size for $strlen so it's set to zero.



Re: Error in sa-mp-status.php - djdanni - 22.03.2009

That can't be. I have boath port open and he is not Offline.


Re: Error in sa-mp-status.php - Delused - 22.03.2009


For me your server IS offline.

When i remove
Код:
$conInfo=stream_get_meta_data($fp);
if($conInfo['timed_out']){
	exit("Server Offline");
}
from my server status script and I turn my server off, I get the same error
Код:
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/admin/forum/serverstatus.php on line 40

Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/admin/forum/serverstatus.php on line 42

Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/admin/forum/serverstatus.php on line 44
So as I previously stated:
Quote:
Originally Posted by Delused
Your server is offline or isn't port forwarded.

You need to add
Код:
	$conInfo=stream_get_meta_data($fp);
	if($conInfo['timed_out']){
		exit("Server Offline");
	}
before $is_passworded.

The '$length' parameter in fread has to be bigger than zero.
Since your server is offline it doesn't receive a size for $strlen so it's set to zero.



Re: Error in sa-mp-status.php - djdanni - 22.03.2009

ok it was somthang wrong with my port 7778. can you test for me 212.30.223.9:7786 ?


Re: Error in sa-mp-status.php - propilot - 22.03.2009

Quote:
Originally Posted by djdanni
ok it was somthang wrong with my port 7778. can you test for me 212.30.223.9:7786 ?
it up for me


Re: Error in sa-mp-status.php - djdanni - 22.03.2009

This is Strance. Can it be that port 7778 is broken or can port's broke?


Re: Error in sa-mp-status.php - Delused - 22.03.2009

Ports can't break.
However if something is already using that port it wont work.


Re: Error in sa-mp-status.php - djdanni - 22.03.2009

How can that be? It woork for 2 day's ago