我正在运行一个PHP脚本,它使用cron作业每分钟插入数据库中的行。
我的提供者说:
An email will be sent to this address ONLY if your cron produces output. If no output is generated, then no email will be sent.
我只是在发生查询错误时在PHP中发出echo语句。 但是我没有错误,而且我看到了数据库中出现的行。
然而,即使我没有错误,我仍然收到(几乎)空的电子邮件:
Content-type: text/html
我怎样才能防止这个? 运行PHP脚本cron作业时被认为是输出的内容?
UPDATE
为了摆脱标题,请参阅: https : //stackoverflow.com/questions/10723546/how-to-get-rid-of-content-type-text-html-in-php-script-output
你有代码中的header任何电话? 任何<?php ... ?>块以外的空格? 为了回答你的问题,“输出”是任何在非CLI操作中发送给浏览器的东西,就像你看到的那个HTTP头。