By default, the working directory for running cron tasks is home
.
To change the working directory, add the following lines to the beginning of the cron file:
$_SERVER['HTTP_HOST'] = 'name_site'; $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; $_SERVER['REQUEST_METHOD'] = 'GET'; chdir('/ home / name_hosting_account / name_site / www / and_Further_путь_к_file');