我使用以下命令通过 cron 执行 PHP 文件
php -q /home/seilings/public_html/dvd/cron/mailer.php
问题是我有一个包含在执行中的文件,该文件确定要加载哪个配置....如下所示:
if (!strstr(getenv('HTTP_HOST'), ".com")) {
$config["mode"] = "local";
} else {
$config["mode"] = "live";
}
cron 正在加载本地配置,而它应该加载实时配置。我尝试使用文件的 http:// URL 而不是绝对路径,但没有找到该文件。我是否需要更改命令才能使用其中的 URL?
另一个简单的解决方案:
cron:
php -q /home/seilings/public_html/dvd/cron/mailer.php local
php:
if (!empty($argv[0])) {
$config["mode"] = "local";
} else {
$config["mode"] = "live";
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)