Plesk PHP-FPM - Troubleshooting outbound email problems.

 

Plesk PHP-FPM - Troubleshooting outbound email problems.

 

Customer reports that he cannot send emails using his mail form on his server.

 

1.) Test SMTP connection from server manually using telnet

2.) If telnet works successfully then do an strace on php-fpm process using the following command:

 

strace -f -s 800 `pidof php-fpm | sed 's/\(\w*\)/-p \1/g'`

 

You might get results similar to the following:

[pid 59310] <... gettimeofday resumed> {1527271887, 376878}, NULL) = 0

[pid 15030] write(4, "\1\7\0\1\2\307\1\0PHP message: PHP Warning:  fopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/vhosts/domain.com/httpdocs/connecttest3.php on line 4\nPHP message: PHP Warning:  fopen(http://www.google.com): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/vhosts/domain.com/httpdocs/connecttest3.php on line 4\nPHP message: PHP Warning:  fread() expects parameter 1 to be resource, boolean given in /var/www/vhosts/domain.com/httpdocs/connecttest3.php on line 5\nPHP message

[pid 59310] write(4, "[25-May-2018 11:11:27] WARNING: [pool domain.com] child 15030 said into stderr: \"NOTICE: PHP message: PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in /var/www/vhosts/domain.com/httpdocs/connecttest3.php on line 6\"\n", 248 <unfinished ...>

 

3.) Check for the following logs: /var/log/yum.log and /tmp/autoinstaller.log to see if there is any indication of any PHP or system updates applied.

4.) Run a ps xauw | grep php-f and see if there is a process with an old date

 

[root@domain httpdocs]# ps xauw | grep php-f

dot.net+ 15071 4.6 1.4 517620 26536 ? S 11:11 0:00 php-fpm: pool domain.com
root 15076 0.0 0.0 112708 960 pts/0 R+ 11:11 0:00 grep --color=auto -i php-f
root 56735 0.0 0.1 389728 2836 ? Ss May12 0:32 php-fpm: master process (/etc/php-fpm.conf)
root 59310 0.0 0.3 513252 6688 ? Rs May08 1:19 php-fpm: master process (/opt/plesk/php/5.6/etc/php-fpm.conf)

 

5.) Restart the PHP-FPM process by issuing the following command

service plesk-php56-fpm restart