473,418 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

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

Jul 17 '05 #1
4 1915
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

Jul 17 '05 #2
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.
Jul 17 '05 #3
"Michael Austin" <ma*****@firstdbasource.com> schrieb im Newsbeitrag
news:MG*****************@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

Jul 17 '05 #4
"Michael Austin" <ma*****@firstdbasource.com> schrieb im Newsbeitrag
news:MG*****************@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

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: starlightjen | last post by:
Hello, I'm trying to use php to update my htpasswd file. I have my permissions on .htpasswd set to 777, so it should be wide open. From the command line (when logged into the server as...
6
by: Hal Vaughan | last post by:
I have a script used to find and run Java on a Windows system.  It worked fine on original tests (on a Windows XP system).  It's now running on a Windows 2000 (sp3) system, and it won't work -- the...
1
by: Hal Vaughan | last post by:
I've been using Runtime.exec() like this: Runtime rt = Runtime.getRuntime(); try {Process p = rt.exec("MyCommand.bat");} catch (Exception e) {do stuff} When I start my Java classes, I start...
1
by: Andr? Roberge | last post by:
I have the following two files: #--testexec.py-- def exec_code(co): try: exec co except: print "error" #-- test.py--
17
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
0
by: Christian Rank | last post by:
Today I ran into problems when combining a C program with SQL statements with the ECPG interface of PostgreSQL: According to the documentation, it should be possible with EXEC SQL WHENEVER NOT...
4
by: Michael | last post by:
Hi, I'm having difficulty finding any previous discussion on this -- I keep finding people either having problems calling os.exec(lepev), or with using python's exec statement. Neither of...
7
by: JahMic | last post by:
I'm having a problem with exec on my hosting server. Unfortunately, the hosting support seems to be anything but helpful. The following works fine on my localhost: <?php $MaskData =...
26
by: warth33 | last post by:
Hello I have a php site. Some page needs to call an external program. The programs are home made c# applications. It uses to work without problem. For a while. Maybe it work for some hour....
23
by: Maarten | last post by:
Howdy, Recently I switched from a Windows PC to Mac OS-X 10.5 (php v5.2.6) and I have a little problem with one function within my cd-management script. For extracting a bit of info from my...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.