Getting rsync to work on Windows, run from a PHP script
Posted on 2007-07-28
I'm using the symfony framework, and am trying to use rsync to update my server files.
I have PHP 5.2.3 installed, and am using cwRsync (my computer is Windows XP via Parallels, on a Mac).
When I run symfony's command in DOS to execute rsync, I get the following command:
rsync --progress --dry-run -azC --delete --exclude-from=config/rsync/exclude.txt -e "ssh -p22" ./ firstname.lastname@example.org:/usr/home/user/myproject/
But nothing else happens. When I cancel the command (by pressing Ctrl-C), I get the error:
Error in my_thread_global_end(): 1 threads didn't exit
Terminate batch job (Y/N)?
The code that's causing the command line to freeze is:
passthru($cmd.' 2>&1', $return);
$content = ob_get_contents();
symfony is meant to use SSH to handle rsync, and I contacted my host, and they said they support both rsync and SSH.
I'm not sure where the error is happening, but I suspect that this is a PHP issue.
Apologies if my suspicion is incorrect, and I would appreciate any help in directing me to where the problem and solution might be.