Jump to content

Home

Game Server Stats & Status Downloads


LoRdNaTaS

Recommended Posts

  • Replies 78
  • Created
  • Last Reply

I have got SWBF PHP Stats to work on Winblows... :p

Anyways this is what you have to do to get it to work...

 

If your Winblows Box is setup to only run command line php from within the php directory download this file:

http://www.apocalypce.net/downloads/php_stats/CMD_FILES/getstats_cmd.zip

 

If your Winblows Box is setup to run command line php from anywhere download this file:

http://www.apocalypce.net/downloads/php_stats/CMD_FILES/getstats_anywhere_cmd.zip

 

Once you have one or the others downloaded then you will need to copy your includes directory from the root swbf_php_stats folder to your php directory if you downloaded the first file.

 

If you downloaded the second file then you need to put the extracted file into your root directory of swbf_php_stats.

 

To test to make sure these work just double click the .cmd file that was extracted.

 

If you get an error like this "php is not recognized as an internal or external command, operable program or batch file.[\b]"

 

Then this means that you have to run command line php from your root php directory which should be something like this: "c:\php"

 

Once you have it setup here is the full readme plus how to setup a scheduled task on Winblows

http://www.apocalypce.net/modules.php?name=Forums&file=viewtopic&p=51

 

Here is a working example of the system:

http://64.122.127.138/swbf_php_stats/

Link to comment
Share on other sites

I'm trying to get the php stats running on a freebsd 4.10 system but am having troubles.

 

when I run the getstats.php from a command line, i see the following:

PHP Fatal error: Call to undefined function mysql_connect() in /usr/local/www/data-dist/stats/includes/conn.php on line 18

 

Also, when calling the scripts in apache2, it seems to not process the mysql_connect either. The headers and footers display, but no server stats.

 

The machine is running freebsd 4.10

apache 2

php 5.0.2

mysql 4.0.21

 

Any help?

Link to comment
Share on other sites

PHP Fatal error: Call to undefined function mysql_connect() in /usr/local/www/data-dist/stats/includes/conn.php on line 18

 

One of two things is happening..

 

1. PHP was not compiled with mysql as an option..

FIX: Recompile PHP with --mysql

 

2. You do not have this line in your httpd.conf file

 

AddType application/x-httpd-php .html .php .phtml

 

I personally would try reason 2 first and if that line is there then you are most likly going to have to recompile php with the --mysql option.

Link to comment
Share on other sites

fixed the php issue, but ran into a whole new one.

 

from the command line, I would get the following errors:

PHP Notice: Undefined variable: buf in /usr/local/www/data-dist/stats/getstats.php on line 37

PHP Notice: Undefined offset: 1 in /usr/local/www/data-dist/stats/getstats.php on line 41

PHP Notice: Undefined offset: 3 in /usr/local/www/data-dist/stats/getstats.php on line 42

PHP Notice: Undefined offset: 5 in /usr/local/www/data-dist/stats/getstats.php on line 43

PHP Notice: Undefined offset: 7 in /usr/local/www/data-dist/stats/getstats.php on line 44

PHP Notice: Undefined offset: 9 in /usr/local/www/data-dist/stats/getstats.php on line 45

PHP Notice: Undefined offset: 11 in /usr/local/www/data-dist/stats/getstats.php on line 46

PHP Notice: Undefined offset: 13 in /usr/local/www/data-dist/stats/getstats.php on line 47

PHP Notice: Undefined offset: 15 in /usr/local/www/data-dist/stats/getstats.php on line 48

PHP Notice: Undefined offset: 17 in /usr/local/www/data-dist/stats/getstats.php on line 49

PHP Notice: Undefined offset: 19 in /usr/local/www/data-dist/stats/getstats.php on line 50

PHP Notice: Undefined offset: 21 in /usr/local/www/data-dist/stats/getstats.php on line 51

PHP Notice: Undefined offset: 23 in /usr/local/www/data-dist/stats/getstats.php on line 52

PHP Notice: Undefined offset: 25 in /usr/local/www/data-dist/stats/getstats.php on line 53

PHP Notice: Undefined offset: 27 in /usr/local/www/data-dist/stats/getstats.php on line 54

PHP Notice: Undefined offset: 29 in /usr/local/www/data-dist/stats/getstats.php on line 55

PHP Notice: Undefined offset: 43 in /usr/local/www/data-dist/stats/getstats.php on line 68

PHP Notice: Undefined offset: 45 in /usr/local/www/data-dist/stats/getstats.php on line 69

 

(the line numbers might be different than the original since I added some debug lines.)

 

In short, the getstats.php would fail on fread($socket,1) therefore setting the unread_bytes to 0. $buf never gets created, and the rest of the script bombs out.

 

I debugged for several hours trying to figure out why I wasn't getting data from the server... until it finally hit me.

 

*&%^$*$) LAN GAME!

 

I switched the server off of lan game and the stats came up in a flash... 301 bytes came in from the server.

 

 

SO my question is: When running in LAN game, is there another way to request data from the server?

Link to comment
Share on other sites

just another update:

running the getstats.php from the cmd line, I now get the following warning:

 

PHP Warning: Unknown: 2 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in Unknown on line 0

 

Any ideas? (perhaps it's just the empty databases, i'll fill them tomorrow when I play)

Link to comment
Share on other sites

ok now that i have seemed to get the data in mysql when i try to login as server admin i get this.

 

 

 

Warning: main(): Unable to access ../../includes/conn.php in /srv/www/htdocs/web30/html/bf/stats/admin/includes/functions.php on line 8

 

Warning: main(../../includes/conn.php): failed to open stream: No such file or directory in /srv/www/htdocs/web30/html/bf/stats/admin/includes/functions.php on line 8

 

Warning: main(): Failed opening '../../includes/conn.php' for inclusion (include_path='.:/usr/share/php') in /srv/www/htdocs/web30/html/bf/stats/admin/includes/functions.php on line 8

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /srv/www/htdocs/web30/html/bf/stats/admin/includes/functions.php on line 254

Could not access the db not auth given:

 

fyi i do not have shell access.

Link to comment
Share on other sites

I saw this on a test machine as well.

I fixed it by hardcoding the paths for the include (I know, I know, bad programming practice to hardcode, but it did the trick for me)

 

so edit the /admin/functions.php and change the includes.

from "../../includes/conn.php"

to "/srv/www/htdocs/web30/html/bf/stats/includes/conn.php"

(minus the quotes)

 

do this for all the main php pages and see if the errors goes away.

 

I assume this is just a misconfigured apache setting.

Link to comment
Share on other sites

On the lan game I will have to look into that. I have not test it on a lan game at all.

 

I will see what I can come up with over the weekend.

 

PHP Notice: Undefined offset: 1 in /usr/local/www/data-dist/stats/getstats.php on line 41

 

This usally is just because the settings in the php.ini for errors is set to check everything which should not be on a production server. But I will aslo looking into this. It should just be that I have not declared all the vars before calling them. I know bad programming..

 

 

Could not access the db not auth given:

 

This is due to not getting the conn.php file. This holds all the database info and if you don't have that then the sql will fail.

 

The hard coding of the the includes should fix this. Which I would guess is another issue in the php.ini not in the apache config.

 

Check to see if you have included defined in your php.ini file on winblows for included to work anywhere it should be set to ./

and the same should be on Linux.

Link to comment
Share on other sites

lol i gotta have every bad thing in the book lol

 

it now says this

 

Could not access the db not auth given: Unknown column 'password' in 'field list'

 

 

FYI i do have all the correct setting in my conn.php file also. i copied them from my config.php on my forums.

 

 

also just so you can see it your self here is the page

 

http://www.njoc.org/bf/stats/admin/index.php

Link to comment
Share on other sites

Looks good. I was just running through my referers on my site and noticed that your stats were not working... thats why I sent the email.

 

I do check on those sometimes. One to see if anyone is having issues and if they are to see if I can fix it just from the error codes that I have put into the code.

 

I try to keep you guys happy. :)

Link to comment
Share on other sites

bad link this is what i get when i click it .

 

 

 

The page cannot be found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

 

--------------------------------------------------------------------------------

 

Please try the following:

 

If you typed the page address in the Address bar, make sure that it is spelled correctly.

 

Open the http://www.apocalypce.net home page, and then look for links to the information you want.

Click the Back button to try another link.

Click Search to look for information on the Internet.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...