连接超时NGINX php-fpm mail()

我正在从Apache服务器和NGINX服务器移植一个PHP站点。 首先,我将摆脱apache以避免任何问题:

 # service httpd stop # yum erase httpd* 

现在我要安装php-fpm所以我可以通过NGINX扩展phpfunction:

 # yum install php-fpm 

让我们确保php-fpm在正确的用户下运行:

 # ps aux | grep apache apache 1658 0.0 0.5 222552 5316 ? S 20:41 0:00 php-fpm: pool www apache 1659 0.0 1.0 227268 10536 ? S 20:41 0:00 php-fpm: pool www apache 1660 0.0 1.0 227268 10420 ? S 20:41 0:00 php-fpm: pool www apache 1661 0.0 1.0 227268 10420 ? S 20:41 0:00 php-fpm: pool www apache 1662 0.0 0.5 222552 5316 ? S 20:41 0:00 php-fpm: pool www 

不是…所以如果:

 # vi /etc/php-fpm.d/www.conf # service php-fpm restart # ps aux | grep nginx nginx 2379 0.0 0.3 222264 3504 ? S 21:47 0:00 php-fpm: pool www nginx 2380 0.0 0.3 222264 3504 ? S 21:47 0:00 php-fpm: pool www nginx 2381 0.0 0.3 222264 3504 ? S 21:47 0:00 php-fpm: pool www nginx 2382 0.0 0.3 222264 3504 ? S 21:47 0:00 php-fpm: pool www nginx 2383 0.0 0.3 222264 3508 ? S 21:47 0:00 php-fpm: pool www 

神奇…让我们看看当我从我的应用程序调用一个mail()调用时会发生什么:

 postfix/pickup[2305]: 6B9B6223BD: uid=497 from=<nginx> postfix/cleanup[2393]: 6B9B6223BD: message-id=<[email protected]> postfix/qmgr[2306]: 6B9B6223BD: from=<[email protected]>, size=367, nrcpt=1 (queue active) postfix/smtp[2396]: connect to gmail-smtp-in.l.google.com[173.194.75.26]:25: Connection timed out postfix/smtp[2396]: connect to alt1.gmail-smtp-in.l.google.com[173.194.65.26]:25: Connection timed out postfix/smtp[2396]: connect to alt2.gmail-smtp-in.l.google.com[173.194.70.27]:25: Connection timed out postfix/smtp[2396]: connect to alt3.gmail-smtp-in.l.google.com[173.194.69.27]:25: Connection timed out postfix/smtp[2396]: connect to alt4.gmail-smtp-in.l.google.com[173.194.71.26]:25: Connection timed out postfix/smtp[2396]: 6B9B6223BD: to=<[email protected]>, relay=none, delay=151, delays=0.03/0.01/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[173.194.71.26]:25: Connection timed out) 

那么我的盒子真的可以弄清楚如何到达Gmail吗?

 # host -t mx gmail.com gmail.com mail is handled by 20 alt2.gmail-smtp-in.l.google.com. gmail.com mail is handled by 30 alt3.gmail-smtp-in.l.google.com. gmail.com mail is handled by 40 alt4.gmail-smtp-in.l.google.com. gmail.com mail is handled by 5 gmail-smtp-in.l.google.com. gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com. 

肯定可以..哼哼..

让我注意到这是在本地运行的客户Centos 6.3 VM。

问题是我无法使用当前configuration传送邮件。

我不知道下一步该做什么,任何指导将不胜感激。

看起来好像我的ISP阻止了端口25上的出站通信。我可以通过比较连接来确认这一点:

 telnet gmail-smtp-in.l.google.com 25 

在我的本地盒子和ISP外面的远程盒子上。 遥控盒能够连接。

至less我觉得那是怎么回事。