arrays - How to diagnose an issue with php exec function when $return is false -
hi i'm having problem script meant run multiple times successfully. using following code have diagnosed script running half time, whereas other half doesn't seem running correctly @ all.
i have figured out using $return value of exec function shown below:
exec("exec /bin/bash ./ygtoyn.sh $filename $yname 2>&1", $output, $return); if($return !== 0){ // exec successful if $return_var set 0. !== means equal , identical, is integer , zero. echo "file not created"; } else{ echo "file created successfully"; } print_r($output);
however need figure out why script not running correctly half of time. there method can use diagnose issue is? $output variable appearing empty array.
here output when run code:
file not created
array ( )
file created
array ( )
file not created
array ( )
file created
array ( )
file created
array ( )
file not created
array ( )
update 1: i've printed out value of $return 1. according link hiteksoftware means incorrect function. can explain might be?
Comments
Post a Comment