Gestionar las cookies que se utilizan con fines publicitarios, como la personalización de anuncios, el remarketing y el análisis del rendimiento de los anuncios.
2.12.8. Change cron working directory
The default working directory for running cron tasks is home.
PHP script
Add the following lines to the beginning of the script being launched (use your own site name and path):
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['REQUEST_METHOD'] = 'GET';
chdir('/home/example/example.com/www/path/to/dir');
Linux commands
Use this method if you get an error like "cd: No such file or directory" when you start the task.
- Create a file with any name (for example,
cron.sh) on the hosting server with the following content:#!/bin/bash here, specify the commands to be run - Add a cron task and specify the path to the created file as the task itself.