fnobi / php-express

enable express server to exec php.
36 stars 15 forks source link

need means of increasing maxBuffer for child-process exec #10

Open mfeblowitz opened 8 years ago

mfeblowitz commented 8 years ago

Large response sizes from php scripts trigger maxBuffer error:

Error: stdout maxBuffer exceeded.    
at Socket.<anonymous> (child_process.js:792:12)    
at Socket.emit (events.js:107:17)    
at readableAddChunk (_stream_readable.js:163:16)    
at Socket.Readable.push (_stream_readable.js:126:10)    
at Pipe.onread (net.js:538:20)

This can be resolved by inserting a maxbuffer increase in engine.js. line 39, e.g.:

child_process.exec(command,  {maxBuffer: 1024 * 15000}, function (error, stdout, stderr) 

Not sure how best to pass in such an argument when configuring php-express - would be preferable to editing source for each installation.