1 /etc/httpd/conf/httpd.conf文件里搜索 User和Group,可以查看对应的用户和组. 2 ls -l /usr/sbin/sendmail 查看属主和组以及权限
在httpd.conf里有apache的执行用户和用户组, <IfModule !mpm_netware_module> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User nobody Group nobody </IfModule> 你再看下/usr/sbin/sendmail 文件夹的权限,对比下就行了。
2 ls -l /usr/sbin/sendmail
查看属主和组以及权限
<IfModule !mpm_netware_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User nobody
Group nobody
</IfModule>
你再看下/usr/sbin/sendmail 文件夹的权限,对比下就行了。
而/usr/sbin/sendmail的所有者是root,
造成了php的mb_send_mail和mail函数发送邮件是总是返回false(猜测是这个原因),
请问怎么修改他们,才能使发送邮件成功?
虽然属主可能是root
但要看其的权限
lrwxrwxrwx ,比如说,我的系统里就是777权限.
/usr/sbin/sendmail 是lrwxrwxrwx ,
请问您知道邮件发送不成功的原因吗?