473,322 Members | 1,781 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,322 software developers and data experts.

Problem with executing a command from within my script

I'm working on a web-based mail quarantine management system, and am
running into some problems getting it to run the command to release a
message.

The main exertp of the script is below:

<?php

echo "Releasing /var/amavis/quarantine/" . $_POST['release'] . " to
user " . $_POST['user'] . "<br><br>";
$command = "/usr/sbin/amavisd-release " . $_POST['release'] . " " .
$_POST['secretid'];
echo $command . "<br>";
passthru($command, $return_val);
echo "<br>" . $return_val;
?>

End script

This command works fine from the command line, but won't run using this
code. It comes back with a return code of 13 each time. I've also
tried the exec and popen functions in place of passthru() with no luck.
If it matters any, amavisd-release is an executable Perl script.

Any ideas?

Mike Gaskins

Jul 24 '06 #1
1 1427
On 24 Jul 2006 13:36:08 -0700, "Mike Gaskins" <mb*****@clemson.eduwrote:
>I'm working on a web-based mail quarantine management system, and am
running into some problems getting it to run the command to release a
message.

The main exertp of the script is below:

<?php

echo "Releasing /var/amavis/quarantine/" . $_POST['release'] . " to
user " . $_POST['user'] . "<br><br>";
$command = "/usr/sbin/amavisd-release " . $_POST['release'] . " " .
$_POST['secretid'];
echo $command . "<br>";
passthru($command, $return_val);
echo "<br>" . $return_val;
?>

End script

This command works fine from the command line, but won't run using this
code. It comes back with a return code of 13 each time. I've also
tried the exec and popen functions in place of passthru() with no luck.
If it matters any, amavisd-release is an executable Perl script.
The meaning of return codes depends on context, but if it was raised by the OS
then 13 matches "Permission denied", and that seems fairly likely. The user and
environment will be quite different between your command line and the webserver
environment.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 24 '06 #2

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

Similar topics

1
by: Falk Schneider | last post by:
I wrote a PHP shell script under Linux which puts all existing PS-Files within a directory into a list and should then start a single Ghostview window for each file. Sounds simple, but it's not: ...
18
by: Brad Pears | last post by:
Can someone give me some sample code on how one would go about executing a command line "command" from within an ASP form? We need to run an application called GnuPG which allows us to encrypt an...
1
by: Phil | last post by:
Hi, I have my create statments for tables, procedures, views, etc in individual Transact-SQL script files (.sql). I wnat to write another script file that executes these scripts in the...
15
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to...
4
by: Madhu Gopinathan | last post by:
Hi All, I am faced with a horrible hang problem. I have a COM exe server that executes some tasks. The task execution manager is a thread that manages the pool of threads, which is 4 per processor....
7
by: David R. | last post by:
Hello all, I would like to generate a Sql-Script-File and a Batch-File to execute the Batch-File over C#-Code and use the SQL-File as an Input-File for the command "osql" in the Batch-File. I...
5
by: reycri | last post by:
Hi, I need to be able to do this: var func = new Function("var me = <selfRef>; alert(me.params);"); func.params = "This is a test parameter"; window.setTimeout(func, 500); Basically, I...
1
by: Graham Hobbs | last post by:
Hello, My old laptop has DB2 V7 thereon. The only fixpaks I ever applied were FP1 (although I cant truly remember if I actually did this one) and FP2. Because it/they entirely satisfied my needs...
1
by: jaywelbourn | last post by:
Hi, I'm trying to use a .net windows application within linux, using WINE, to run a shell script. The reason is that I need to use linux's dd command on a ext2 filesystem that's on an external...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.