A
A
andrey_levushkin2018-12-29 03:34:48
PHP
andrey_levushkin, 2018-12-29 03:34:48

Why might data not be written to a file when executing a script using KRON?

I'm trying to write data to a file:

$fd = fopen("check_game.txt", 'w+') or die("не удалось создать файл");
$str = "pm";
fwrite($fd, $str);
fclose($fd);

When executing the script manually (using the browser's address bar), everything works fine.
But if I put this script on CRON, then these lines are not executed at all. For some reason the data is not being written to the file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
isrofilov, 2018-12-29
@andrey_levushkin

Relative to the file does not work. Need complete (/home/user/www/site/public/check.txt)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question