Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > Script Languages

Script Languages Perl/PHP/Python/Ruby so on and so forth.

Reply
 
Thread Tools Display Modes
Old 01-04-2007, 05:57 AM   #26 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

Yeah, in the config file look for the cacheType and change it to 1. For that to work though you need to make sure you have your permissions set correctly so that the file can be written and youll have to mess around with that part on your own (change the interval to like 1 second and it will try to rewrite everytime it checks, but sure to change it back though when you are done cause otherwise it is a lot of unneccessary connection to your server on every pageload)
mordero is offline   Reply With Quote
Old 01-22-2007, 06:28 PM   #27 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Hello... Have tried to get this working for 2 days now with no joy. All i get is a white page well sort of off white lol with nothing on it. I think i have everything right but i am not that clued up on all this sort of stuff but i am learning... any help would be appriciated...

Thanks

BurncitY
burncity is offline   Reply With Quote
Old 01-22-2007, 11:57 PM   #28 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

Ok, I made a script that will try to write a text file for a chache and attempt to open a socket, if they both work, you should be good, if the file doesnt write, then you need to fix your permission. If the socket has an error, you're gonna have to figure out whats causing it and check if you even are able to use sockets.

You will have to rename the extension of this file to .php because you cant upload php files on here.
Attached Files
File Type: txt checkservertest.txt (1.8 KB, 23 views)
mordero is offline   Reply With Quote
Old 01-23-2007, 05:17 PM   #29 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Thanks for the reply...

Go this back:

This will test to make sure you have the correct permissions set to write a text file cache and have sockets enabled on your webhost.
You need to make sure that the directory that this file is in is able to be written to (chmod 777 will definately work) and that this file is able to execute (777 again).
Trying to write file: Success in writing file. Check for "CheckServerText.txt" in this directoy.
Trying to open a socket: Sockets successfully opened!!
If sockets were successfully opened and the text file was written, you should be able to use the server checker.

Text file created... So what am i doing wrong... lol
Will keep trying and see if i can get it working... Will keep you up to date with my progress.

Thanks

BurncitY
burncity is offline   Reply With Quote
Old 01-23-2007, 10:01 PM   #30 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

Ok, I should have made that thing a while ago lol. Now that we know you are able to do that, you need to make sure that the servercheck.php has the permissions 777, that way it can write and execute and all that. Then try setting up a test page (Im pretty sure that the header of servercheck.php has an example and I might have even included one in the zip) with an interval of 0 that way it will always try to ping the server and see what comes up.

Its been a while since ive looked at the zip, so if a sample wasnt included or there isnt one in the header, ill write one up for you real quick
mordero is offline   Reply With Quote
Old 01-24-2007, 03:33 AM   #31 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Getting some where now... Still not working though... Getting this now...

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

My head is starting to hurt now... lol
burncity is offline   Reply With Quote
Old 01-24-2007, 04:20 AM   #32 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

This is in the header:

/**
* Filename: checkserver.php
* Version: 1.8
* Author: mordero (*********)
* -Look at the checkserver-config.php file that is include and replace with your values
* -You will need to adjust you permission levels for the directory that these files
* are in (0777 should work, but try setting it lower if you can)
* Usage:
* include_once "checkserver.php";
* $checkserver = new checkserver();
* print $checkserver->statusCheck();
*
* This will output Status [Number Online]
* eg Online [5]
* $checkserver->playersOnline will return just the number online
* $checkserver->status will return just the status
burncity is offline   Reply With Quote
Old 01-24-2007, 09:27 AM   #33 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

ok, well you need to look through the config file and make sure all that stuff is the values you need (the interval needs to be 0 for this test) and then make a page like this
PHP Code:
<?php
include_once "checkserver.php";
$checkserver = new checkserver();
print 
$checkserver->statusCheck();
?>
and it should work, if not then we'll figure something out
mordero is offline   Reply With Quote
Old 01-24-2007, 09:53 AM   #34 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Ok did all that and still "Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request." Not sure what is wrong..
Thanks for the help though...

BurncitY
burncity is offline   Reply With Quote
Old 01-24-2007, 09:56 AM   #35 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Code:
<?php
$defaults = array( // array holding all of the adjustable values
    'host' => "213.228.232.34", //the IP or DNS of the server, do not include http://
    'port' => 2593, // the port to ping, defaults: RunUO : 2593
    'link' => "2F20BBBDC5CD7B930C1CCF7DF9B3BD61", // the URL or UOGateway ID for the server, do not include uog or http
    'RunUO' => true, // true if it is a RunUO server, false if it isnt
    'cacheType' => 3, // 1 is cacheFile, 2 is database, 3 is both, see header of checkserver.php for more details, it is assumed to be 1
    'cacheName' => "servercheck", // this is the name of the file where the status will be store, dont include ".txt"
    'interval' => 0, // the time between checks, in seconds, default is 30 minutes and if set to 0, no cache will be made and will check every page load
    'dbname' => "****",//database name
    'dbuser' => "***",//database username
    'dbpassword' => "******",//database password
    'dbhost' => "localhost",//database host, keep it localhost majority of time
    'dbtable' => "serverstatus", //the table to store values
    );
?>
Is this correct...?
burncity is offline   Reply With Quote
Old 01-24-2007, 10:38 AM   #36 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

yeah, those look good
you are getting an internal server error? Ive never had that problem with any php script ever, so im not sure whats causing that. IM in class right now but ill see if i can write up something sometime tonight that will do some more checks for you. Sorry Until then, see if there is a error log somewhere on your server and see if it mentions anything about this.
mordero is offline   Reply With Quote
Old 01-24-2007, 10:51 AM   #37 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

The error is:

Premature end of script headers: /home/***/public_html/check.php
burncity is offline   Reply With Quote
Old 01-24-2007, 11:16 AM   #38 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

well... crap, i was thinking it might have been some edits i made a while ago that got rid of some checks, but i just uploaded everything to my server and everything worked fine... ill keep working on it when i can though and try to figure out whats wrong.

I know you have probably done this, but i just want to make sure, check.php and checkserver.php needs to have chmod 777, as well as the directory that its in (this can be changed later, but this will make sure there are no problems with permissions), and checkserver-config.php needs to be chmod 644.

All of the files need to be in the same directory and checkserver.php and checkserver-config.php need to keep their filenames the same (check.php can change).

In the config:
Try setting the cacheType to 1 that way it doesnt mess with the database stuff and the interval to 0.

I know youve prolly messed with all of this, but i just want to make sure.

Sorry for your problems
mordero is offline   Reply With Quote
Old 01-24-2007, 01:44 PM   #39 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Well checked it over again and made sure of the correct chmod, changed the cachetype but still the same error....

Thanks for all the help

On another note, I have another web site form the same host and run some modules of it. One on that site is a Teamspeak module. I wanted it on my other site the one in question, I uploaded it to this site, installed it set it up to the relevent ts server but nothing says it is offline... So the question is are these two errors linked somehow
burncity is offline   Reply With Quote
Old 01-24-2007, 02:24 PM   #40 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

Hmmm i dunno if they are related....

But I did do some research on the error you were having. Could you find out what type of server you're host uses and which version of apache? Because there is a bug with some versions of Apache2 and some versions of php where the script is sending out all of the information before apache is ready for it. Sometimes it fixes itself for a bit and sometimes it just keeps doing it. So if you could get my your version of apache (if your webhost uses it) and your version of php, ill see what i can do.
mordero is offline   Reply With Quote
Old 01-24-2007, 05:12 PM   #41 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Operating system Linux

Apache version 1.3.37 (Unix)

PHP version 4.4.4
burncity is offline   Reply With Quote
Old 01-24-2007, 06:32 PM   #42 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

alright, the next thing to try (and this works only if you have access to your php.ini file) is to make doc_root equal nothing:
Code:
doc_root =
then check this out:
Apache, PHP, and WinXP, getting "Premature end of script headers" -- help? - PHP

it says not to make permissions TOO liberal, so you might want to mess with them, but i set them all to 777 for my tests today and it worked fine.
mordero is offline   Reply With Quote
Old 01-25-2007, 03:53 PM   #43 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Cant find no php.ini. Put all permmissions to 777 but still no joy... At least you tried... I dont think we are going to get it working somehow...

Thanks again

BurncitY
burncity is offline   Reply With Quote
Old 01-25-2007, 04:08 PM   #44 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

well last attempt to try to fix this, try using this as your check.php
PHP Code:
<?php 
// example usage
ob_start();
include_once 
"checkserver.php";
$checkserver = new checkserver();
print 
$checkserver->statusCheck();
ob_end_flush();
?>
that will supress any output from the server until the script is finished running. Im 99% sure it wont help, but its worth a shot. sorry
mordero is offline   Reply With Quote
Old 01-26-2007, 03:42 AM   #45 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Age: 35
Posts: 11
Default

Dead end im affraid. I will keep trying different things and if anything changes will let you know...

Thanks

BurncitY
burncity is offline   Reply With Quote
Old 02-01-2007, 08:24 PM   #46 (permalink)
Administrator
 
Zippy's Avatar
 
Join Date: Aug 2002
Location: Baltimore, MD
Age: 25
Posts: 4,832
Default

www.ConnectUO.com

They provide an image that shows the number of players currently online on your shard (updated every 15 minues, will say "Down" if the server is down).

They also have neat graphs for the numbers of players online. Easy solution for what you are trying to do.
__________________
Zippy, Razor Creator and RunUO Core Developer
The RunUO Software Team

"Intuition, like a flash of lightning, lasts only for a second. It generally comes when one is tormented by a difficult decipherment and when one reviews in his mind the fruitless experiments already tried. Suddenly the light breaks through and one finds after a few minutes what previous days of labor were unable to reveal."
~The Cryptonomicon

Zippy is offline   Reply With Quote
Old 02-01-2007, 08:43 PM   #47 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
Default

whelp there ya go no need for me to mess with this anymore
mordero is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5