简体   繁体   English

apache阻止php mail()工作(没有SELinux)

[英]apache prevents php mail() from working (no SELinux)

What's working and what's not: 什么有效,什么无效:

I have a custom sendmail wrapper script which only gets triggered by PHP-Cli but not when executing through Apache php_mod. 我有一个自定义的sendmail包装程序脚本,该脚本仅由PHP-Cli触发,而在通过Apache php_mod执行时则不会触发。

  • When I run $ php mail.php everything just works fine, mail() returns true. 当我运行$ php mail.php一切正常,mail()返回true。
  • When I run the same file through my Apache it does not work, mail() returns false. 当我通过Apache运行同一文件时,该文件不起作用,mail()返回false。
  • In both cases I get an entry in my (php.ini) [mail function] mail.log = ... file. 在这两种情况下,我都在(php.ini) [mail function] mail.log = ...文件中得到一个条目。

The Question: 问题:

So how would I fix this? 那么我该如何解决呢? I want it to work through both PHP-Cli and Apache php_mod. 我希望它可以通过PHP-Cli和Apache php_mod一起工作。

The Setup: 设置:

  • I set the sendmail_path variable in the php.ini file to my custom wrapper script. 我将php.ini文件中的sendmail_path变量设置为我的自定义包装脚本。
  • I do not run SELinux. 我没有运行SELinux。
  • I do not run AppArmor. 我没有运行AppArmor。

  • PHP Version: 5.5.15 PHP版本:5.5.15

  • Apache Version: 2.4.10 Apache版本:2.4.10
  • System is: ArchLinux (Kernel: 3.15.5) 系统是:ArchLinux(内核:3.15.5)

The Config: 配置:

httpd.conf httpd.conf

Edit: 编辑:

As it stands the Apache has no access to the php.ini value of sendmail_path , how would I fix this? 就目前而言,Apache无法访问sendmail_path的php.ini值,我该如何解决?

The list of disable_functions in my php.ini is empty. 我的php.ini中的disable_functions列表为空。

Output of phpinfo() on: phpinfo()在以下位置的输出:

  • PHP-Cli PHP-Cli
  • Apache at pastebin ID: rjjjtUXZ Apache在pastebin ID:rjjjtUXZ

Sorry but I'm currently not allowed to use more than 2 links in my question. 抱歉,我目前不允许在我的问题中使用2个以上的链接。

“ mail”是否在php.ini的disable_functions列表中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM