1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

PHP Socket Open issues

Discussion in 'Web Design & Development' started by NegativeKelvin, Jan 12, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. NegativeKelvin

    NegativeKelvin Thread Starter

    Joined:
    Apr 11, 2012
    Messages:
    298
    Well, I'm setting up a Minecraft Server list. I'm having issues with an error message that shows up when it can't pull data from the server. I uploaded the source code to:
    Source Code: http://negacraft.twilightparadox.com/owncloud/public.php?service=files&t=g9fbsmypct4i8nqb412nl2wlx7ka0af6
    Glitchy Page: http://negacraft.twilightparadox.com/mcstatus/
    Is there a problem with the code? What can I do to fix the issue where it says:

     
  2. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,331
    First Name:
    Jim
    Could you possible post the php script - stats.php - and we can get a better looksee...
     
  3. gurutech

    gurutech

    Joined:
    Apr 23, 2004
    Messages:
    2,960
    The error says the host failed to respond. I'm betting it is responding, but your firewall may not be allowing the connection to come in. Check your firewall settings to allow port 25565 inbound.
     
  4. NegativeKelvin

    NegativeKelvin Thread Starter

    Joined:
    Apr 11, 2012
    Messages:
    298
    No, that server isn't running. I just don't want it to display the error
     
  5. NegativeKelvin

    NegativeKelvin Thread Starter

    Joined:
    Apr 11, 2012
    Messages:
    298
  6. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,331
    First Name:
    Jim
    Is this server necessary? If it never runs, then obviously it is not. But even if it does on occasion, do you need it? I would be tempted to leave the call to this particular stats function out. But that's your call BC:) - You are getting the error message because the server isn't running, therefore don't call the function which tries to connect to it...
     
  7. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,331
    First Name:
    Jim
    How much dumber can I get:mad: Obviously you want to access this site!
    What you may consider is a check to see if it is running before you try and get the stats. I would suggest you look at stream select to determine it's status and call your stats function accordingly (i.e. if it's sending stuff, check stats and dont if it isn't)
     
  8. NegativeKelvin

    NegativeKelvin Thread Starter

    Joined:
    Apr 11, 2012
    Messages:
    298
    It's a Minecraft server, it's down due to maintanance, But rather than it showing the error, I want it to just show a red "X" by the status, without the error.
     
  9. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,331
    First Name:
    Jim
    You could best do that in the program that calls the stat.php (mcstats.php??), by doing a quick check on the site status (stream_select) and setting the red cross image if it's unavailable - if you could post the source for the calling program, I'm sure we can sort something out...:)
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1084812

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice