Verònica Jandrew Verònica Jandrew - 4 months ago 17
PHP Question

Execute php script with crontab doesn't work

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?

Answer Source

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