php – 在XAMPP for Linux中使用mailtodisk / mailoutput
与
Windows不同,我在
Linux中使用“mailtodisk”
PHP选项时遇到了麻烦.看起来它甚至不存在.
在“php.ini”中,在邮件部分中,没有对它的引用: [mail function] ; For Win32 only. ; http://php.net/smtp SMTP=localhost ; http://php.net/smtp-port smtp_port=25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(),even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header=On ; Log all mail() calls including the full path of the script,line #,to address and headers mail.log ="/opt/lampp/logs/php_mail_log" [SQL] 我无法在localhost主页中看到“Mail”链接,用于测试默认邮件表单,因为它有很多崩溃,如下所示: 注意:未定义的变量:第12行的/opt/lampp/htdocs/xampp/start.php中的TEXT Obs:尽管localhost主页有这个错误,但我正在运行没有问题的项目. 事实上,它似乎没有菜单中的“邮件”链接(我搜索了源代码). 我不知道这些信息是否有任何帮助,但文件“sendmail.php”使用的是我系统中不存在的文件:/usr/sbin / sendmail. XAMPP的当前版本是:1.8.3,最近更新. 是否可以在XAMPP for Linux中使用“mailtodisk”?如果是的话,在我的情况下我需要做什么? 解决方法
它不存在,但这是我的mailtodisk脚本:
/选择/ LAMPP / mailtodisk / mailtodisk: #!/opt/lampp/bin/php <?php $input = file_get_contents('php://stdin'); $filename = '/opt/lampp/mailoutput/mail-' . gmdate('Ymd-Hi-s') . '.txt'; $retry = 0; while(is_file($filename)) { $filename = '/opt/lampp/mailoutput/mail-' . gmdate('Ymd-Hi-s') . '-' . ++$retry . '.txt'; } file_put_contents($filename,$input); 您的XAMPP安装可能不在/ opt / lampp文件夹中,如果不是,您需要编辑脚本(尽管它不必存在于XAMPP文件夹中). 确保您的mailtodisk脚本可以由任何人(chmod 755 mailtodisk)运行,并且您的mailoutput文件夹可以由任何人(chmod 777 mailoutput)写入. 然后你的php.ini文件(/opt/lampp/etc/php.ini)应该有: sendmail_path=/opt/lampp/mailtodisk/mailtodisk 每次编辑php.ini文件时,都必须重新启动Apache. 如果您不想发送电子邮件,安装sendmail是过度的. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |