Yes there is a limit, but that has nothing to do with your error.
"Premature end of script headers" means that PHP.exe did not write proper HTTP headers when it sent it's data back to the webserver.
BNy default PHP will do this correctly, but it's possible that you change it's config, or that your script does some illegal action that causes the PHP process to die before/without sending headers.
Does the location wher the temporary files are save exist? is there enough freespace?
...and why are you using http to do an FTP job?