邮件:无法打开流:权限被拒绝? [英] mail: failed to open stream: Permission denied?
问题描述
我收到这个警告发送邮件与php
警告:mail(1)[function.mail]:无法打开流:在/ home /...
I get this warning sending mails with php Warning: mail(1) [function.mail]: failed to open stream: Permission denied in /home/...
- 使用ssmtp和gmail作为smtp
- PHP 5.3.1
- 日志中没有没有错误)
- 邮件到达目的地
- 文件的权限是rwxrxrx
- using ssmtp and gmail as smtp
- PHP 5.3.1
- nothing in the logs (no errors)
- the mail gets to destination
- the permissions of the files are rwxrxrx
权限被拒绝为什么?
甚至调用简单的
mail(mail@domain.com,subject,body);
mail("mail@domain.com", "subject", "body");
我仍然收到此警告
推荐答案
毕竟,事实证明是一个文件权限问题。但不是在脚本中,而是在目录中。
我运行了一个 chmod -R 777 *
,并发出警告。进一步检查后,我发现一个名为 1
的文件,该文件包含发送邮件的日志。
警告告诉我他无法打开这个文件。
It turns out to be a file permissions problems after all. But not in the scripts, but in the directory.
I ran a chmod -R 777 *
and the warning went of. upon further examination I found a file called 1
, and this file contained a log of the sent mails.
The warning was php telling me that he was unable to open this file
解决方案:
sudo chmod -R 755 *
sudo chmod 777 1
F#$%^%cryptic php错误消息
F#$%^% cryptic php error messages
这篇关于邮件:无法打开流:权限被拒绝?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!