如果我从bat文件执行php脚本,邮件功能不起作用

时间:2015-12-01 11:10:55

标签: php email batch-file

这是我的php脚本:

enter image description here

我的php.ini:

enter image description here

如果我使用浏览器执行脚本,它可以正常工作:

enter image description here

但如果我使用bat文件执行脚本,它就不起作用。 enter image description here

这里是我的bat文件: enter image description here

1 个答案:

答案 0 :(得分:1)

好像php没有阅读php.ini。

运行命令php --ini,看看加载配置文件:是否正确。

你可以通过添加选项-c:

告诉php在哪里找到合适的php.ini
php -c C:\php\php.ini -f C:\wamp\...\mail.php