Trouble in PHP adventures =/

Ask about a PHP problem here.
Post Reply
User avatar
killfrog47
Posts: 106
Joined: Tue Mar 12, 2013 2:52 am
Location: Tempe, AZ
Contact:

Trouble in PHP adventures =/

Post by killfrog47 »

Hello all,
So I have been fighting with this code to ping my minecraft server:
<?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>";
?>
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:
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
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
ExtremeGaming
Posts: 205
Joined: Mon Jul 09, 2012 11:13 pm

Re: Trouble in PHP adventures =/

Post by ExtremeGaming »

Are the required ports open?
<?php while(!$succeed = try()); ?>
User avatar
killfrog47
Posts: 106
Joined: Tue Mar 12, 2013 2:52 am
Location: Tempe, AZ
Contact:

Re: Trouble in PHP adventures =/

Post 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! =(
User avatar
Helx
Posts: 350
Joined: Thu May 17, 2012 6:45 am
Location: Auckland, New Zealand

Re: Trouble in PHP adventures =/

Post by Helx »

What kind of host are you using for the web?
They might be blocking you.
User avatar
killfrog47
Posts: 106
Joined: Tue Mar 12, 2013 2:52 am
Location: Tempe, AZ
Contact:

Re: Trouble in PHP adventures =/

Post 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
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Trouble in PHP adventures =/

Post by Temor »

they probably have a firewall or something that blocks that port. they should be able to open it for you.
User avatar
Helx
Posts: 350
Joined: Thu May 17, 2012 6:45 am
Location: Auckland, New Zealand

Re: Trouble in PHP adventures =/

Post 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 :) .
Post Reply