This is a discussion on exec problems within the PHP Language forums, part of the PHP Programming Forums category; Hi, i have more then less Problems with this script. the php.ini have this config: Safe_Mode = ON, Regest_Globals == OFF &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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><title>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 |
|
|||
|
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: > 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><title>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 > |
|
|||
|
Adrian Pach wrote:
> 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><title>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 > see the topic "opendir() in safe mode" dated 6/24 Michael Austin. |
|
|||
|
"Michael Austin" <maustin@firstdbasource.com> schrieb im Newsbeitrag
news:MGWCc.8714$fY3.7586@newssvr24.news.prodigy.co m... > Adrian Pach wrote: > > > 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><title>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 > > > > see the topic "opendir() in safe mode" dated 6/24 > > > Michael Austin. Thanks, what is what i want. Adrian PS. if it works i wrote it down there and then not too |
|
|||
|
"Michael Austin" <maustin@firstdbasource.com> schrieb im Newsbeitrag
news:MGWCc.8714$fY3.7586@newssvr24.news.prodigy.co m... > Adrian Pach wrote: > > > 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><title>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 > > > > see the topic "opendir() in safe mode" dated 6/24 > > > Michael Austin. 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 |