虽然我可以在chroot中使用sendmail,但PHP无法在chroot中进行邮件发送()
我正在构build一个php-fpm chroot,并且是我最后一个步骤之一,然后才称之为成功。 php-fpm chroot就像一个魅力。 此外,我已经将mini_sendmail安装到chroot(代替sendmail),并且可以确认它可以发送电子邮件: [root@hostname site1.com]# ls bin/ bash cat sendmail test.txt [root@hostname site1.com]# chroot . bash-4.2# cat /bin/test.txt | ./bin/sendmail -t -i [email protected] [email protected] 上述命令运行时,我会收到电子邮件。 但是,当我从Web浏览器访问下面的PHP脚本时,不发送电子邮件: <?php $message = "This is a test"; $headers = 'From: [email protected]'; mail("[email protected]", "Test", $message, $headers); echo "mail sent"; ?> 下面是我的php-fpm chroot池configuration文件: [site1.com] user = user1 group = […]