Swiftmail错误:fork失败 - 无法分配内存

时间:2013-11-15 14:32:05

标签: php swiftmailer

我使用sendmail方法通过swiftmail(5.0.1)发送5k电子邮件:

$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -t');

我曾经没有任何问题,但我很快就得到了这个错误:

Warning: proc_open() [function.proc-open]: fork failed - Cannot allocate memory in /swmailer501/classes/Swift/Transport/StreamBuffer.php on line 285

Warning: stream_set_blocking(): supplied argument is not a valid stream resource in /swmailer501/classes/Swift/Transport/StreamBuffer.php on line 286

Warning: stream_get_contents() expects parameter 1 to be resource, null given in /swmailer501/classes/Swift/Transport/StreamBuffer.php on line 287

Warning: fclose(): supplied argument is not a valid stream resource in /swmailer501/classes/Swift/Transport/StreamBuffer.php on line 108

Warning: fclose(): supplied argument is not a valid stream resource in /swmailer501/classes/Swift/Transport/StreamBuffer.php on line 109

Warning: proc_close() expects parameter 1 to be resource, boolean given in /swmailer501/classes/Swift/Transport/StreamBuffer.php on line 110

我尝试了不同的配置和发送方法,但没有成功,有什么想法吗?

1 个答案:

答案 0 :(得分:0)

你要么合法地耗尽系统内存,要么你有坏内存。

我不熟悉Swift_SendmailTransport,但是从你的错误来看,它似乎是产生进程,由于内存不足而无法启动。

如果是先前的,您可能希望尝试一次少量运行或向机器添加更多内存。