Soe Naung Win
Soe Naung Win

Reputation: 15

exec() command from web server in php

Is there anyway to use atrm command to remove queue job from PHP web application? I wrote a shell script to remove the queue job but it doesn't work well.

#! /bin/sh

export PATH=/usr/local/bin:$PATH

echo atrm 3700 2>&1

Upvotes: 1

Views: 961

Answers (3)

Rofael Behnam
Rofael Behnam

Reputation: 39

You can use shell_exec or exec PHP function :

$output=shell_exec($commandstring);
print_r($output);

or

 exec($commandstring,$output,$returnval);
 print_r($output);
 print_r($returnval);

Upvotes: 0

codaddict
codaddict

Reputation: 454950

You can try doing:

echo exec('export PATH=/usr/local/bin:$PATH ; atrm 3700 2>&1');

Upvotes: 1

YOU
YOU

Reputation: 123791

Try atrm 3700 2 > &1 without echo

Upvotes: 0

Related Questions