Page 1 of 1

Trouble in PHP adventures =/

Posted: Tue Mar 26, 2013 6:16 pm
by killfrog47
Hello all,
So I have been fighting with this code to ping my minecraft server:
[syntax=php]<?php
$multiverseConn = fsockopen('31.205.82.73', '25565', $errno, $errstr, 1);
$multiverse = false;
if ($multiverseConn)
{
$multiverse = true;
fclose($multiverseConn);
}
if ($multiverse)
{
echo "Server is: Online";
}
else
{
echo "Server is: Offline";
}
echo "<div>Errno: $errno <br />";
echo "Errstr: $errstr </div>";
?>[/syntax]

It is working for others and not for me. Now i did ask and make sure i have fsockopen access and i do. The server is listening on 25565 what am i doing wrong? I keep gettin this error: [syntax=text]Warning: fsockopen() [function.fsockopen]: unable to connect to 31.205.82.73:25565 (Connection timed out) in /home/tcordero/public_html/index.php on line 36
Server is: Offline
Errno: 110
Errstr: Connection timed out[/syntax] You can see an example at http://tccraft.net in the top right. Also the IP and port for the server are this: 31.205.82.73:25571

Re: Trouble in PHP adventures =/

Posted: Sun Mar 31, 2013 4:31 pm
by ExtremeGaming
Are the required ports open?

Re: Trouble in PHP adventures =/

Posted: Wed Apr 03, 2013 4:37 am
by killfrog47
Yes they are. The code seems to work for others too idk why its not working. I can NOT find code to do such a simple thing! =(

Re: Trouble in PHP adventures =/

Posted: Wed Apr 03, 2013 4:40 am
by Helx
What kind of host are you using for the web?
They might be blocking you.

Re: Trouble in PHP adventures =/

Posted: Wed Apr 03, 2013 5:54 am
by killfrog47
Helx wrote:What kind of host are you using for the web?
They might be blocking you.

I am using a company called arvixe. I opened a ticket with them about it see what they have to say about it

Re: Trouble in PHP adventures =/

Posted: Thu Apr 04, 2013 2:53 am
by Temor
they probably have a firewall or something that blocks that port. they should be able to open it for you.

Re: Trouble in PHP adventures =/

Posted: Thu Apr 04, 2013 3:56 am
by Helx
Temor wrote:they probably have a firewall or something that blocks that port. they should be able to open it for you.

Well, being a web-host they probably have had troubles with people running MineCraft servers on their systems :P

If they refuse to open the port, I'd suggest http://x10premium.com. They give so much trust to their users :) .