0

我的脚本在浏览器中运行时运行良好,但在使用 cron 运行时无法运行

require_once('/home/dekh/public_html/track/classes/affiliate.class.php');
require_once('/home/dekh/public_html/track/classes/offer.class.php');
require_once('/home/dekh/public_html/track/classes/merchant.class.php');
require_once('/home/dekh/public_html/track/includes/emails.php');
$mer=new Merchant;
$aff=new Affiliate;
$offer=new Offer;
$message = "Line 1\nLine 2\nLine 3";
$message = wordwrap($message, 70);
mail('my email address', 'My Subject', $message);

我在浏览器中运行它时收到邮件

这是我如何在 cron 中添加它的

wget /home/dekh/public_html/track/includes/cron_for_conversions_mail.php
php /home/dekh/public_html/track/includes/cron_for_conversions_mail.php

我已经尝试过两种方式 php /home.. 和 wget /home...

请推荐谢谢

4

1 回答 1

1

wget url 但不是本地文件

就像:

  http://127.0.0.1/cron_for_conversions_mail.php
于 2013-06-06T05:48:10.767 回答