Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1271213
  • 博文数量: 107
  • 博客积分: 1456
  • 博客等级: 上尉
  • 技术积分: 1868
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-13 15:33
文章分类

全部博文(107)

文章存档

2021年(2)

2016年(8)

2015年(8)

2014年(10)

2013年(20)

2012年(38)

2011年(21)

分类: Python/Ruby

2012-08-17 09:10:01

遇到一个奇怪的问题。使用mail()函数发信时,浏览器返回如下错误:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.More information about this error may be available in the server error log.

error_og提示:Premature end of script headers: .phpparser

但查看maillog,邮件已经sent出去了。

在排除PHP环境问题之后发现,在发送邮件之前,maillog有报这两行错误:

My unqualified host name (l135) unknown;

sleeping for retryunable to qualify my own domain name (l135) -- using short name

可以看出,与服务器设置的主机名l135有关。或许这个主机名不够规范吧。于是修改/etc/sysconfig/network,将其设置为l135.com,并在/etc/hosts里添加一条l135.com的解析记录,然后重启network和sendmail。但发信还是会报这两个错误。

难道是新的主机名没有生效?于是hostname一下,发现确实还是l135.于是重启系统。

重启之后发现,hostname的结果是l135.com,用sendmail发信,已不会有那两行报错了,再测试mail()函数发信,也正常了。

 

 

阅读(1127) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~