S
S
Stanislav2014-02-24 14:14:00
PHP
Stanislav, 2014-02-24 14:14:00

Why does sending mail via php mail() stop working over time?

vds on digitalocean, tariff for $5 - 512 ram of RAM
The server runs centos 6.4 + php 5.5 + httpd + mysql
Sites - 4 pieces, all test, without strong activity.
Sites do not slow down when loading.
The mailer costs postfix.
After start httpd - mail sends normally. After a while I get the following messages:
string(36) "Could not instantiate mail function."
Warning: mail(): Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /var/www/public_html/includes/test.php on line 14
error 1 - php mailer class output, error 2 - output of the usual mail function.
Through the console at this time sending mail works. those. the problem is clearly in php + httpd.
It seems to me that the problem is lack of memory.
However, a swap was made, which is maximum occupied by 50%, and the main RAM is either 50% or 90% full.
In logs /var/log/maillog it is deaf. In the httpd logs - the same as above.
/usr/sbin/sendmail is a symbolic link to /alternatives/mta, which in turn leads to /usr/sbin/sendmail.postfix, i.e. shipping goes through it. sendmail itself is not installed.
Any ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Yakovlev, 2014-02-24
@delfi

most likely out of memory.
do you use prefork on apache? If yes, how many childs?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question