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`

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?

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.

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 meeting, networking, learning, and sharing knowledge.