Alegis Posted October 19, 2004 Share Posted October 19, 2004 Remove the first part of the SQL (before the first drop table if exists), that worked for me. Link to comment Share on other sites More sharing options...
LoRdNaTaS Posted October 19, 2004 Author Share Posted October 19, 2004 Sorry about that guys. I will mod the sql file right now so no one else should have this issue. Link to comment Share on other sites More sharing options...
LoRdNaTaS Posted October 19, 2004 Author Share Posted October 19, 2004 I have got SWBF PHP Stats to work on Winblows... 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 More sharing options...
(NJOC)MasterJedi[L] Posted October 20, 2004 Share Posted October 20, 2004 ok now it;s a new error lok at this Error SQL-query : -- -- LOCK TABLES servers WRITE MySQL said: #1044 - Access denied for user: 'web30@localhost' to database 'usr_web30_1' can you help? Link to comment Share on other sites More sharing options...
LoRdNaTaS Posted October 20, 2004 Author Share Posted October 20, 2004 #1044 - Access denied for user: 'web30@localhost' to database 'usr_web30_1' your user web30 does not have lock enabled in its setting on the databases. Remove this from all the create statements LOCK TABLES servers WRITE That should fix it. Link to comment Share on other sites More sharing options...
JediCow5 Posted October 20, 2004 Share Posted October 20, 2004 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 More sharing options...
LoRdNaTaS Posted October 20, 2004 Author Share Posted October 20, 2004 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 More sharing options...
JediCow5 Posted October 21, 2004 Share Posted October 21, 2004 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 More sharing options...
JediCow5 Posted October 21, 2004 Share Posted October 21, 2004 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 More sharing options...
(NJOC)MasterJedi[L] Posted October 21, 2004 Share Posted October 21, 2004 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 More sharing options...
JediCow5 Posted October 21, 2004 Share Posted October 21, 2004 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 More sharing options...
LoRdNaTaS Posted October 21, 2004 Author Share Posted October 21, 2004 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 More sharing options...
(NJOC)MasterJedi[L] Posted October 21, 2004 Share Posted October 21, 2004 not using winblows am using linux. Link to comment Share on other sites More sharing options...
(NJOC)MasterJedi[L] Posted October 21, 2004 Share Posted October 21, 2004 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 More sharing options...
LoRdNaTaS Posted October 21, 2004 Author Share Posted October 21, 2004 easy fix... Change password to passwd my fault. that should fix it.. The field in the table admin is passwd.. I will release a patch for that shortly. Sorry about that. Link to comment Share on other sites More sharing options...
LoRdNaTaS Posted October 22, 2004 Author Share Posted October 22, 2004 New Patch for SWBF PHP Stats. SWBF PHP Stats Patch 0.1 was released: 21-Oct-2004 Minor fix for the admin login.. there was an issue the password field Link to comment Share on other sites More sharing options...
JediCow5 Posted October 25, 2004 Share Posted October 25, 2004 Any luck with LAN game monitoring? Link to comment Share on other sites More sharing options...
(NJOC)MasterJedi[L] Posted October 25, 2004 Share Posted October 25, 2004 thanks man it seems to be working now .i updated my whole site yesterday .wen t with a little different style looks better .put the live staus and the stats on the there also . check it out njoc site Link to comment Share on other sites More sharing options...
LoRdNaTaS Posted October 25, 2004 Author Share Posted October 25, 2004 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 More sharing options...
(NJOC)MasterJedi[L] Posted October 25, 2004 Share Posted October 25, 2004 thanks but yes here are some more errors. when i try to login to admin this is the new info a get since i updated with patch You are not authorized to enter this area. Username: Password: lol sorry but if you could help i would be greatful by the way iedited it but i still cannot login to admin page. Link to comment Share on other sites More sharing options...
LoRdNaTaS Posted October 25, 2004 Author Share Posted October 25, 2004 try this download. It is a moded admin functions include file http://www.apocalypce.net/downloads/swbf_stats_admin.rar Link to comment Share on other sites More sharing options...
(NJOC)MasterJedi[L] Posted October 25, 2004 Share Posted October 25, 2004 m,an i am so sorry but i most have every problem in the book.here is the newest Could not access the db not auth given: Unknown column 'password' in 'field list' you think i should just give up?? Link to comment Share on other sites More sharing options...
LoRdNaTaS Posted October 25, 2004 Author Share Posted October 25, 2004 Sorry I forgot to change the password field to passwd.. Download the rar file again and that should fix it. http://www.apocalypce.net/downloads/swbf_stats_admin.rar Link to comment Share on other sites More sharing options...
(NJOC)MasterJedi[L] Posted October 25, 2004 Share Posted October 25, 2004 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 More sharing options...
LoRdNaTaS Posted October 25, 2004 Author Share Posted October 25, 2004 try this: http://www.apocalypce.net/downloads/swbf_stats_admin.rar Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.