Help with a socket script execution

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • steven.rojas@gmail.com

    #1

    Help with a socket script execution

    I have a chat application based on PHP and Flash, I know that is
    necessary execute the socket server script from the console (#!/usr/
    local/bin/php -q), but my problem is that I don't have SSH access to
    the server where I have to deploy the application (a godaddy server).
    Locally I could run the script even in my browser and the chat works
    fine, but if I run the script in the server from the browser I
    couldn't connect to it. Is there a way to run my socket script without
    having SSH access to the server?

  • =?ISO-8859-15?Q?Iv=E1n_S=E1nchez_Ortega?=

    #2
    Re: Help with a socket script execution

    steven.rojas@gm ail.com wrote:
    I have a chat application based on PHP and Flash, I know that is
    necessary execute the socket server script from the console (#!/usr/
    local/bin/php -q), but my problem is that I don't have SSH access to
    the server [...]
    Meet your new friend, php.net/exec .

    And, if you're out of luck (i.e. the server runs with safe_mode on), you can
    always rely on the (very) dirty trick of using a "Connection : close" HTTP
    request, along with some PHP magic so the script doesn't die when the HTTP
    connection is actually closed. I suggest you to do some research about
    that.

    --
    ----------------------------------
    Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

    http://acm.asoc.fi.upm.es/~mr/ ; http://acm.asoc.fi.upm.es/~ivan/
    MSN:i_eat_s_p_a _m_for_breakfas t@hotmail.com
    Jabber:ivansanc hez@jabber.org ; ivansanchez@kde talk.net

    Comment

    • steven.rojas@gmail.com

      #3
      Re: Help with a socket script execution

      On 3 jul, 21:14, Iván Sánchez Ortega <ivansanchez-...@rroba-
      escomposlinux.-.punto.-.orgwrote:
      steven.ro...@gm ail.com wrote:
      I have a chat application based on PHP and Flash, I know that is
      necessary execute the socket server script from the console (#!/usr/
      local/bin/php -q), but my problem is that I don't have SSH access to
      the server [...]
      >
      Meet your new friend, php.net/exec .
      >
      And, if you're out of luck (i.e. the server runs with safe_mode on), you can
      always rely on the (very) dirty trick of using a "Connection : close" HTTP
      request, along with some PHP magic so the script doesn't die when the HTTP
      connection is actually closed. I suggest you to do some research about
      that.
      >
      --
      ----------------------------------
      Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
      >

      MSN:i_eat_s_p_a _m_for_breakf.. .@hotmail.com
      Jabber:ivansanc ...@jabber.org ; ivansanc...@kde talk.net
      I have luck!! my server is not compiled with safe_mode off... could
      you give me a few details about how to use exec command? This command
      only execute something and finish it execution or wait until the
      command finish? I try with the following doesn't work:
      <?php
      $command = $APP_PATH . "/controllers/chat.php";
      exec($command);
      echo("done...") ;
      ?>

      when I execute the script, the browser never finished the script I
      couldn't see "done..."

      Comment

      • Jerry Stuckle

        #4
        Re: Help with a socket script execution

        steven.rojas@gm ail.com wrote:
        On 3 jul, 21:14, Iván Sánchez Ortega <ivansanchez-...@rroba-
        escomposlinux.-.punto.-.orgwrote:
        > steven.ro...@gm ail.com wrote:
        >>I have a chat application based on PHP and Flash, I know that is
        >>necessary execute the socket server script from the console (#!/usr/
        >>local/bin/php -q), but my problem is that I don't have SSH access to
        >>the server [...]
        >Meet your new friend, php.net/exec .
        >>
        >And, if you're out of luck (i.e. the server runs with safe_mode on), you can
        >always rely on the (very) dirty trick of using a "Connection : close" HTTP
        >request, along with some PHP magic so the script doesn't die when the HTTP
        >connection is actually closed. I suggest you to do some research about
        >that.
        >>
        >--
        >----------------------------------
        >Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
        >>
        >http://acm.asoc.fi.upm.es/~mr/;http:....upm.es/~ivan/
        >MSN:i_eat_s_p_ a_m_for_breakf. ..@hotmail.com
        >Jabber:ivansan c...@jabber.org ; ivansanc...@kde talk.net
        >
        I have luck!! my server is not compiled with safe_mode off... could
        you give me a few details about how to use exec command? This command
        only execute something and finish it execution or wait until the
        command finish? I try with the following doesn't work:
        <?php
        $command = $APP_PATH . "/controllers/chat.php";
        exec($command);
        echo("done...") ;
        ?>
        >
        when I execute the script, the browser never finished the script I
        couldn't see "done..."
        >
        That means your chat.php script didn't complete before you PHP timeout
        value.

        Is this script supposed to be running all the time?


        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        Working...