I had this in a large project of about 70 applications. I noticed that some of the generated code was being corrupted, which may have contributed to the error.
As with lot of SC stuff, you need a kludge. My solution was to split the deployment; one for applications, one for libraries, one for graphics. A PITA, but it worked. Asking for a fix is probably a wast of time so best just to make the most of what you got. Or try another PHP generator.
NB: If using firefox as your browser, some suggest that in about:config change the value of network.http.accept-encoding to true