, 나는이 오류 . 내 다른 램프 서버에서 동일한 코드가 제대로 작동합니다. 제가 도움이 될만한 것이 있다면 제가 빠진 부분을 지적하십시오. 미리 감사드립니다.:</p> <blockquote> <p>Error 324 (net::ERR_EMPTY_RESPONSE):</p> </blockquote> <p>서버가 데이터를 전송하지 않고 연결을 종료 : PHP를 사용하여 원격 SFTP를 위치에 존재하는 파일을 나열하는 중에
function listBuildFiles() {
global $sftp_host, $sftp_username, $sftp_password, $sftp_path;
$connection = ssh2_connect($sftp_host);
// Authenticate
if (!ssh2_auth_password($connection, $sftp_username, $sftp_password)) {
throw new Exception('Unable to connect.');
}
// Create our SFTP resource
if (!$sftp = ssh2_sftp($connection)) {
throw new Exception('Unable to create SFTP connection.');
}
/**
* Now that we have our SFTP resource, we can open a directory resource
* to get us a list of files. Here we will use the $sftp resource in
* our address string as I previously mentioned since our ssh2://
* protocol allows it.
*/
$files = array();
$dirHandle = opendir("ssh2.sftp://$sftp$sftp_path");
$i=0;
// Properly scan through the directory for files, ignoring directory indexes (. & ..)
while (false !== ($file = readdir($dirHandle))) {
if ($file != '.' && $file != '..') {
$files[$i] = $file;
$i++;
}
}
echo '<select name="buildName">';
echo '<option>Please Select a build</option>';
foreach ($files as $filename) {
echo "<option value=\"$filename\">$filename</option>";
}
echo '</select>';
ssh2_exec($connection, "exit");
감사합니다, Ujjwal
PHP/Apache 로그를 살펴 보셨습니까? –
그리고 sshd 로그를 보셨습니까? – dave4420