hi all
what i want to do is that when im running a shell script, if there is error(like permition denied) i wil be able to catch it as string

my code is

$cmd= `sh /blabla/bla.sh`
print_r($cmd);

if the script is ruuning with no errors, im able to print what the script does, but i want to save the errors msg also(so i can send them to somewhere else).
is there a way to do this?
10x

Recommended Answers

All 2 Replies

Take a look at http://uk.php.net/manual/en/function.exec.php

nope, i've tried the exec() command also.

$tmp=exec("/var/www/check.php",$lines);
print_r($lines) //show me array()
echo/print_r($tmp) //print me nothing

doesnt show me the errors...
the error for this case is that its not a script....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.