Как заставить функцию php ssh2_sftp() аварийно завершить работу или истечь тайм-аутом, а не зависать?Php

Кемеровские программисты php общаются здесь
Гость
Как заставить функцию php ssh2_sftp() аварийно завершить работу или истечь тайм-аутом, а не зависать?

Сообщение Гость »


Я пытаюсь подключиться к FTP с помощью следующего кода на PHP

Код: Выделить всё

$connection = ssh2_connect($host, $port);
ssh2_auth_password($connection, $user, $password);
$sftp = ssh2_sftp($connection);
However, instead of triggering an error, the script just hangs.
When I try connecting via the linux command line, I get the error

Код: Выделить всё

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login:  from 
Could not chdir to home directory /xxx/xxx/./xxx/xxxx/xxx: No such file or directory
Connection to  closed.
How do I get the script to trigger an error (preferably something more specific about what happened) instead of hanging?


Источник: https://stackoverflow.com/questions/781 ... d-of-hangi

Вернуться в «Php»