ConFoo Montreal 2026: Call for Papers

Voting

: max(seven, four)?
(Example: nine)

The Note You're Voting On

mao at nospam dot com
20 years ago
If you have ftp (and the related sftp) protocols disabled on your remote server, it can be hard figuring out how to 'stat' a remote file. The following works for me:

<?php

$conn
= ssh2_connect($host, 22);
ssh2_auth_password($conn, $user, $password);
$stream = ssh2_exec($conn, "stat $fileName > $remotedest");
ssh2_scp_recv($conn, $remotedest, $localdest);
$farray = file($localdest);
print_r($farray);
?>

<< Back to user notes page

To Top