[php函数mail保存]php函数mail()报Could not instantiate mail function.错误解决

更新时间:2019-11-23    来源:php函数    手机版     字体:

【www.bbyears.com--php函数】


网上有很多朋友用phpmailer组件发送邮件提示:Could not instantiate mail function.错误,解决方案少之用少,原因是服务器没有安装sendmail组件,使用yum进行安装:

yum install sendmail
/etc/init.d/sendmail start

    注意:如果sendmail启动缓慢,请将hostname加入到/etc/hosts里面

   配置/usr/local/php/etc/php.ini,填写sendmail绝对路径:

vim /usr/local/php/etc/php.ini
sendmail_path = /usr/sbin/sendmail -t -i
:wq!
/etc/init.d/php-fpm restart

本文来源:http://www.bbyears.com/jiaocheng/80659.html