Re: Hoping for a working example of SFTP in PHP

[email protected] ("R. Eric Wheeler")
Newsgroups php.general
Message-ID <[email protected]>
David,

Yes.  This fixed the timeout happening for me.  Using WAMP and cmd.exe 
on windows and apache 2.4 on linux.

You can also try using set_time_limit at the top of the script with a 
high value.

You might need to debug the ssh connection on the server at this point 
and see exactly what it is it doing.
You can set the option LogLevel to DEBUG in /etc/ssh/sshd_config and 
restart.  Then run 'tail -f /var/log/auth.log' in the console.

Although both file_exists and copy work on streams, you can also try 
using fopen and fwrite instead like the example links Jose sent to the list.

Eric

On 2/6/21 6:09 PM, David Spector wrote:
> Eric, Thank you for all your work. Shows how uninterested the world is 
> in having good secure file copying in PHP.
>
> But after I changed the end of the program to
>
> ssh2_disconnect($sftp);
> ssh2_disconnect($connection);
>
> the same error happens (a browser timeout). Are you sure these two 
> statements are correct?
>
> David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.