dthh5038 2011-11-04 11:03
浏览 30

cron tab不工作php

I added a cronjob by entering this command - crontab -e. I added the following tasks in that file-

*/5 * * * * /var/www/web/vendors/shells/aggregated_deals.php
*/5 * * * * /var/www/web/vendors/shells/deals.php

These are php scripts. after that i restarted the apache server,but these scripts are not executing. And syslog log file is empty. please help me to run this cron.

  • 写回答

8条回答 默认 最新

  • doudaotui4297 2011-11-04 11:14
    关注

    I don't think you can execute a PHP file by calling it like that, I always use a curl:

    */5 * * * * curl http://domain.com/page
    

    Or I guess you could run it using the php command itself if you don't want to use the web server:

    */5 * * * * php /var/www/web/vendors/shells/aggregated_deals.php
    

    What ever you type after the stars in the crontab rule will be the command execute against the system. If you run the command "/var/www/web/vendors/shells/aggregated_deals.php" in terminal I bet nothing happens...you need to invoke this as a PHP script.

    评论

报告相同问题?

悬赏问题

  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000