Domanda

I have a file that works fine from manual execution, but it does not work from a cron job.

I used full-path in the command area like,

/usr/local/bin/php /home/kam/public_html/filename.php
È stato utile?

Soluzione

If you have cURL installed, this should work:

Replace:

/usr/local/bin/php /home/kamalam4/public_html/filename.php

With: (replace www.your-domain.com with your own site domain/URL)

curl --silent --compressed http://www.your-domain.com/filename.php

Altri suggerimenti

Go to command line and do "crontab -e" . Write the cronjob entry

example :- to set a 1 min cron : */1 * * * * /usr/local/bin/php /home/kamalam4/public_html/filename.php

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top