exec problems

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 &...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-25-2004
Adrian Pach
 
Posts: n/a
Default 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><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

Reply With Quote
  #2 (permalink)  
Old 06-25-2004
Mike
 
Posts: n/a
Default 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:

> 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
>

Reply With Quote
  #3 (permalink)  
Old 06-25-2004
Michael Austin
 
Posts: n/a
Default Re: exec problems

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.
Reply With Quote
  #4 (permalink)  
Old 06-26-2004
Adrian Pach
 
Posts: n/a
Default Re: exec problems

"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

Reply With Quote
  #5 (permalink)  
Old 06-26-2004
Adrian Pach
 
Posts: n/a
Default Re: exec problems father on.

"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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:20 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0