php - How to detect Connection Closed error when transferring files in phpseclib -
i have php cli daemon sending files via sftp regularily flaky server, , before fix server want implement error handling in script.
after logging in succesfully, run command , works 70% of time:
if ($sftp->put("/home/whatever/$name","$local_path")) { print "no problem\n"; } else { print "is problem\n"; }
i don't care if connection doesn't work, because can make daemon try again, problem these errors , daemon dies:
php notice: connection closed server in /usr/share/pear/net/ssh2.php on line 1009 notice: connection closed server in /usr/share/pear/net/ssh2.php on line 1009
the "is problem" message never appears, program dies.
how can detect when connection close without script dying?
Comments
Post a Comment