exec problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adrian Pach

    #1

    exec problems

    Hi,

    i have more then less Problems with this script.
    the php.ini have this config:

    Safe_Mode = ON, Regest_Globals == OFF

    <?php
    $server = $_GET[Server];
    $_ENV['PATH']="/path/path2";

    if ($prog == "start") { on(); };
    if ($prog == "stop") { off(); };

    function on () {
    exec("/path/path2/script start", $error );
    echo "$error[0]<br> $error[1]<br> $error[2]<br>start";
    }

    function off () {
    exec("/path/path2/script stop", $error);
    echo "$error[0]<br> $error[1]<br> $error[2] <br>stopt";
    }


    echo "<html><head><t itle>TESTING</title></head><body>";
    echo "<form ation=\"./path/phpscript.php\" method=\"GET\"> "
    ."<input type=\"submit\" name=\"prog\" value=\"start\" >"
    ."<input type=\"submit\" name=\"prog\" value=\"stop\"> "
    ."</form>";
    echo "</body></html>";

    So my problem is that the messages are writen on screen and it seems
    to bee run, but finally the prog doesn't start.
    The messages are the same as i start the prog over the shell with
    ../prog start. The Prog is a bash-programm that start a deamon with
    childprozess.

    Who can help me?

    best regards
    Adrian

  • Mike

    #2
    Re: exec problems

    I think ....... that you must check php.net. I think a security settings
    has to do with it (safe mode). This shoudl be changed at the php
    configuration.


    Adrian Pach wrote:
    [color=blue]
    > Hi,
    >
    > i have more then less Problems with this script.
    > the php.ini have this config:
    >
    > Safe_Mode = ON, Regest_Globals == OFF
    >
    > <?php
    > $server = $_GET[Server];
    > $_ENV['PATH']="/path/path2";
    >
    > if ($prog == "start") { on(); };
    > if ($prog == "stop") { off(); };
    >
    > function on () {
    > exec("/path/path2/script start", $error );
    > echo "$error[0]<br> $error[1]<br> $error[2]<br>start";
    > }
    >
    > function off () {
    > exec("/path/path2/script stop", $error);
    > echo "$error[0]<br> $error[1]<br> $error[2] <br>stopt";
    > }
    >
    >
    > echo "<html><head><t itle>TESTING</title></head><body>";
    > echo "<form ation=\"./path/phpscript.php\" method=\"GET\"> "
    > ."<input type=\"submit\" name=\"prog\" value=\"start\" >"
    > ."<input type=\"submit\" name=\"prog\" value=\"stop\"> "
    > ."</form>";
    > echo "</body></html>";
    >
    > So my problem is that the messages are writen on screen and it seems
    > to bee run, but finally the prog doesn't start.
    > The messages are the same as i start the prog over the shell with
    > ./prog start. The Prog is a bash-programm that start a deamon with
    > childprozess.
    >
    > Who can help me?
    >
    > best regards
    > Adrian
    >[/color]

    Comment

    • Michael Austin

      #3
      Re: exec problems

      Adrian Pach wrote:
      [color=blue]
      > Hi,
      >
      > i have more then less Problems with this script.
      > the php.ini have this config:
      >
      > Safe_Mode = ON, Regest_Globals == OFF
      >
      > <?php
      > $server = $_GET[Server];
      > $_ENV['PATH']="/path/path2";
      >
      > if ($prog == "start") { on(); };
      > if ($prog == "stop") { off(); };
      >
      > function on () {
      > exec("/path/path2/script start", $error );
      > echo "$error[0]<br> $error[1]<br> $error[2]<br>start";
      > }
      >
      > function off () {
      > exec("/path/path2/script stop", $error);
      > echo "$error[0]<br> $error[1]<br> $error[2] <br>stopt";
      > }
      >
      >
      > echo "<html><head><t itle>TESTING</title></head><body>";
      > echo "<form ation=\"./path/phpscript.php\" method=\"GET\"> "
      > ."<input type=\"submit\" name=\"prog\" value=\"start\" >"
      > ."<input type=\"submit\" name=\"prog\" value=\"stop\"> "
      > ."</form>";
      > echo "</body></html>";
      >
      > So my problem is that the messages are writen on screen and it seems
      > to bee run, but finally the prog doesn't start.
      > The messages are the same as i start the prog over the shell with
      > ./prog start. The Prog is a bash-programm that start a deamon with
      > childprozess.
      >
      > Who can help me?
      >
      > best regards
      > Adrian
      >[/color]

      see the topic "opendir() in safe mode" dated 6/24


      Michael Austin.

      Comment

      • Adrian Pach

        #4
        Re: exec problems

        "Michael Austin" <maustin@firstd basource.com> schrieb im Newsbeitrag
        news:MGWCc.8714 $fY3.7586@newss vr24.news.prodi gy.com...[color=blue]
        > Adrian Pach wrote:
        >[color=green]
        > > Hi,
        > >
        > > i have more then less Problems with this script.
        > > the php.ini have this config:
        > >
        > > Safe_Mode = ON, Regest_Globals == OFF
        > >
        > > <?php
        > > $server = $_GET[Server];
        > > $_ENV['PATH']="/path/path2";
        > >
        > > if ($prog == "start") { on(); };
        > > if ($prog == "stop") { off(); };
        > >
        > > function on () {
        > > exec("/path/path2/script start", $error );
        > > echo "$error[0]<br> $error[1]<br> $error[2]<br>start";
        > > }
        > >
        > > function off () {
        > > exec("/path/path2/script stop", $error);
        > > echo "$error[0]<br> $error[1]<br> $error[2] <br>stopt";
        > > }
        > >
        > >
        > > echo "<html><head><t itle>TESTING</title></head><body>";
        > > echo "<form ation=\"./path/phpscript.php\" method=\"GET\"> "
        > > ."<input type=\"submit\" name=\"prog\" value=\"start\" >"
        > > ."<input type=\"submit\" name=\"prog\" value=\"stop\"> "
        > > ."</form>";
        > > echo "</body></html>";
        > >
        > > So my problem is that the messages are writen on screen and it[/color][/color]
        seems[color=blue][color=green]
        > > to bee run, but finally the prog doesn't start.
        > > The messages are the same as i start the prog over the shell with
        > > ./prog start. The Prog is a bash-programm that start a deamon with
        > > childprozess.
        > >
        > > Who can help me?
        > >
        > > best regards
        > > Adrian
        > >[/color]
        >
        > see the topic "opendir() in safe mode" dated 6/24
        >
        >
        > Michael Austin.[/color]

        Thanks,

        what is what i want.

        Adrian

        PS. if it works i wrote it down there and then not too

        Comment

        • Adrian Pach

          #5
          Re: exec problems father on.

          "Michael Austin" <maustin@firstd basource.com> schrieb im Newsbeitrag
          news:MGWCc.8714 $fY3.7586@newss vr24.news.prodi gy.com...[color=blue]
          > Adrian Pach wrote:
          >[color=green]
          > > Hi,
          > >
          > > i have more then less Problems with this script.
          > > the php.ini have this config:
          > >
          > > Safe_Mode = ON, Regest_Globals == OFF
          > >
          > > <?php
          > > $server = $_GET[Server];
          > > $_ENV['PATH']="/path/path2";
          > >
          > > if ($prog == "start") { on(); };
          > > if ($prog == "stop") { off(); };
          > >
          > > function on () {
          > > exec("/path/path2/script start", $error );
          > > echo "$error[0]<br> $error[1]<br> $error[2]<br>start";
          > > }
          > >
          > > function off () {
          > > exec("/path/path2/script stop", $error);
          > > echo "$error[0]<br> $error[1]<br> $error[2] <br>stopt";
          > > }
          > >
          > >
          > > echo "<html><head><t itle>TESTING</title></head><body>";
          > > echo "<form ation=\"./path/phpscript.php\" method=\"GET\"> "
          > > ."<input type=\"submit\" name=\"prog\" value=\"start\" >"
          > > ."<input type=\"submit\" name=\"prog\" value=\"stop\"> "
          > > ."</form>";
          > > echo "</body></html>";
          > >
          > > So my problem is that the messages are writen on screen and it[/color][/color]
          seems[color=blue][color=green]
          > > to bee run, but finally the prog doesn't start.
          > > The messages are the same as i start the prog over the shell with
          > > ./prog start. The Prog is a bash-programm that start a deamon with
          > > childprozess.
          > >
          > > Who can help me?
          > >
          > > best regards
          > > Adrian
          > >[/color]
          >
          > see the topic "opendir() in safe mode" dated 6/24
          >
          >
          > Michael Austin.[/color]

          all works fine. Now i can start the program, but it starts with the
          user apache and not with the user xxx what i have configured. The user
          xxx can go on a html-page and must be authorized himself with
          password, the apache server know which user there are. But the skript
          is not started with this user. WHY?

          Hope someone can help me?

          Adrian

          Comment

          Working...