Closed Thread
Results 1 to 10 of 10
Like Tree2Likes
  • 2 Post By Brandon

Thread: php Server Status Help

  1. #1
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    php Server Status Help

    http://www.customcf.smfhelp.com/images/x10free.png

    cPanel always is offline

    PHP Code:
    // CPANEL Only port 2082

    imagettftext($background12021583$white'arial.ttf'"cPanel:");

    $fp = @fsockopen('64.92.165.74'2082$errno$errstr3);
    if (!
    $fp){
    $data 'Offline';
    $color $red;
    } else {
    $data 'Online';
    $color $green;
    }
    @
    fclose($fp);
    imagettftext($background12026083$color'arial.ttf'$data);
    // HTTP Only port 80

    //cPanel Only Port 2082 
    Is there something to add there to make it to work.
    Thanks,
    Brandon Long

  2. #2
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: php Server Status Help

    more like cpanel is always on, when the server is on cpanel is on so i wouldn't even bother having cpanel down as a service lol
    BUT let me check what i used lol, been soo long
    Last edited by Jake; 11-05-2006 at 12:00 AM.
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  3. #3
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: php Server Status Help

    I use this in JM:

    PHP Code:
    <?php
       
    function checkPort($ipAddress$port) {
          
    $handle = @fsockopen($ipAddress$port$errno$errstr5);
          if (
    $handle == false) {
             return 
    false;
          }
          else {
             return 
    true;
          }
       }
    ?>
    PHP Code:
    <?php
       $status 
    =  checkPort('64.92.165.74'2082);
       if (
    $status == true) {
          
    $data 'Online';
          
    $color $green;
       }
       else {
          
    $data 'Offline';
          
    $color $red;
       }

    ?>
    See if that works for you, I know it does for me. I know they're basically the same things, but hmmm. Try to echo $errno and $errstr also if it's still not working. There are other ways to do it, so if this doesn't work, we can find another way.
    Last edited by Bryon; 11-05-2006 at 12:20 AM.

  4. #4
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: php Server Status Help

    figures you'd find it in that jumble of code before i could... lol
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  5. #5
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: php Server Status Help

    Quote Originally Posted by Jake
    figures you'd find it in that jumble of code before i could... lol
    SVN, OOP, and folder already open made it pretty easy, haha. :sleep2:
    Last edited by Bryon; 11-05-2006 at 12:25 AM.

  6. #6
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: php Server Status Help

    on checkport() I get this error

    Code:
    <br /> <b>Fatal error</b>:  Call to undefined function:  checkport() in <b>/home/customcf/public_html/images/x10free.php</b> on line <b>44</b><br />
    Quote Originally Posted by Jake
    more like cpanel is always on, when the server is on cpanel is on so i wouldn't even bother having cpanel down as a service lol

    BUT let me check what i used lol, been soo long
    umm so if the server is down but cPanel is up, wont they get confused
    Last edited by Brandon; 11-05-2006 at 11:18 AM.
    dinomirt96 and karimirt47 like this.
    Thanks,
    Brandon Long

  7. #7
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: php Server Status Help

    http://www.customcf.smfhelp.com/images/x10free.png

    Saying error 110, Connection Timed Out
    Thanks,
    Brandon Long

  8. #8
    Jake's Avatar
    Jake is offline Developer Jake is an unknown quantity at this point
    Join Date
    Apr 2005
    Location
    Winona, MN
    Posts
    2,084

    Re: php Server Status Help

    Quote Originally Posted by blong4life
    Quote Originally Posted by Jake
    more like cpanel is always on, when the server is on cpanel is on so i wouldn't even bother having cpanel down as a service lol

    BUT let me check what i used lol, been soo long
    umm so if the server is down but cPanel is up, wont they get confused
    no i mean just dont put it on the sig... lol but you can if you want i wont stop you

    second, dont double post

    third, the reason its not working is because you dont have BOTH code snippets he posted in your php file. the first code defines the function checkport() and the second code is just using the function.
    Last edited by Jake; 11-06-2006 at 06:47 PM.
    Jake Omann | Developer
    █ 888-X10-9668 - jake[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  9. #9
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: php Server Status Help

    Quote Originally Posted by Jake
    no i mean just dont put it on the sig... lol but you can if you want i wont stop you

    second, dont double post

    third, the reason its not working is because you dont have BOTH code snippets he posted in your php file. the first code defines the function checkport() and the second code is just using the function.
    lol

    second, my edit button disapeered so i had to make a new post sry

    third, now its always offline damit...this will work but how
    Thanks,
    Brandon Long

  10. #10
    anhminh is offline x10 Sophmore anhminh is an unknown quantity at this point
    Join Date
    Jul 2006
    Posts
    108

    Re: php Server Status Help

    Why Brandon say "cPanel always is offline"? It is must be online to WORK (never offline)?

Closed Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  3. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  4. server status from x10hosting
    By Mikek in forum Feedback and Suggestions
    Replies: 11
    Last Post: 09-26-2005, 01:17 PM
  5. PHP Server Status.
    By Nathan in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 07-12-2005, 08:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers