dongyouzhui1969 2017-04-06 09:37
浏览 136
已采纳

使用crontab执行php脚本不起作用

I'm trying to execute a php script every day to send an automatic email to the clients that have contacted me. To try if it works I'm trying to execute it every minute. I have followed these steps:

  1. whereis php prompts
php: /usr/bin/php /usr/share/php /usr/share/man/man1/php.1.gz

2. Then I make crontab -e and add a line:

* * * * * /usr/bin/php /var/www2/www/centros-sbc.com/public_html/mail/mail_automatico.php &>> /dev/null

Then I wait a minute and nothing happens. Have any idea?

  • 写回答

4条回答 默认 最新

  • duande1986 2017-04-13 11:16
    关注

    Finally I succeed by making it more simple:

            • /usr/bin/php /var/www2/www/centros-sbc.com/public_html/mail/mail_automatico.php

    Thanks to all

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?