I have been trying to let know know if the exec() command in php executes successfully or not so i can echo certain messages accordingly.
I tried the following
The correct way is to check that the $return_var was not set to zero because it is only set to zero when it is successful. In certain cases the exec can fail and the return_var is not set to anything. E.g. if the server ran out of disk space during the exec.
Note : do not initialize $return_var to zero