Hi,
How can I allow the shell session to stay open until I close it with PHP?
In my example I want to use NcFtp to publish some files through shell command. I want to leave PHP's built in FTP because it is much much slower and performance is an issue.
It is easy to use ncftpput
to publish a file or a directory. But if I want to loop through an array of say 10 files, the script will have to log in, publish, log out, log in, publish, log out ...
It would be much more convenient if something like this could work.
shell_exec('ncftp -u username -p password');
foreach ( $files as $file )
{
shell_exec('put '.$file['local_path'].' '.$file['remote_path']);
}
shell_exec('quit');
Is it possible?
Thank you!