2.11.8. Changing cron's working directory

The default working directory for running cron jobs is home.

Add to the beginning of the running script:

$_SERVER['HTTP_HOST'] = 'name_site  ';
Use this method if you get an error like "cd: No such file or directory".
  1. Create a hosting file with any name (for example, cron.sh) and the following content:
    specify the commands to be run
  2. Add cron task and specify the path to the created file as the task itself.