M
M
Millerish2016-03-14 14:47:16
PHP
Millerish, 2016-03-14 14:47:16

Why is cron handled differently than page refresh?

Good afternoon!
I have a script that checks when a file was updated. If there was no update, it sends a letter. When updating the page (http) it works, if I run it through cron - all the time I think that there was no update (letter). Tried different cron intervals, always the same result.
Cron:
/usr/bin/php ~/www/XXX.XXX.XXX/vi-test/date-inspection/index.php >/dev/null 2>&1
Script:
https://jsfiddle.net/5hjj9mgq/
Prompt , why is this happening? How to fix?
ZY
Please do not judge strictly, I did not work with krona, the draft script.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2016-03-14
@Millerish

php file by itself will not run
either php /bla/bla/file
or browser lynx localhost/file
lyul wget localhost/file
see ways
www.htmlcenter.com/blog/running-php-scripts-with-cron

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question