Checking exec() runs successfully or not

前端 未结 4 530
小鲜肉
小鲜肉 2020-12-07 20:13

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

4条回答
  •  无人及你
    2020-12-07 21:11

    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

提交回复
热议问题