2026/07/25
|
Saturday, July 25, 2026 (#206)
|
|
References |
Main Work
Ferreteria FileSys stuff in order to support sftp in FTM
I'm in a bit of a stuck place where #phpseclib is throwing an error while trying to read a file over sftp but isn't giving any indication of what the problem is.
Original error message:
PHP Warning: fopen(sftp://...@sameagle.local/home/woozle/test/Benjamin/Banking/2020-01-05.Nelnet payment.pdf): Failed to open stream: "phpseclib3\Net\SFTP\Stream::stream_open" call failed in /home/woozle/Sync/dev/local/v0.6/ferreteria/src/Sys/FileSys/Aspect/Connx/Stream/File/SecLib.php on line 48
(The actual URL being opened is "sftp://root@sameagle.local/home/woozle/test/Benjamin/Banking/2020-01-05.Nelnet payment.pdf"; I presume the "..." is just PHP reducing the string-length for readability.
When I dump the SFTP object's getErrors(), I get this:
Array
(
[0] => SSH_MSG_GLOBAL_REQUEST: hostkeys-00@openssh.com
[1] => SSH_MSG_DEBUG: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
[2] => SSH_MSG_DEBUG: /root/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
)
...which looks more like diagnostic information than any actual errors.
Thing is, this part of the system was working properly with PHP's native ssh2 (PHPSSH2). The reason I had to start using phpseclib is that PHPSSH2 doesn't provide a way to set timestamps on remote files. ...and that's it, that's ultimate the only reason I needed it (so far, anyway).
...so maybe I need to tweak things just a little bit more so I can use phpseclib for fine-grained stuff and PHPSSH2 for file I/O.