Problem with crontab

Hello!
I installed atrocore with PHP 8.4 and apache server , but I always have error with crontab
I defined a cron like properly (I have only deprecated php message).

Could you help me please?

but there are always problem

image

Hello,

Thank you for the details. The PHP deprecation messages are harmless. What matters is that cron starts the background processes (daemons) of AtroCore. Please check the following steps. Your installation will not run jobs until these processes are running.

1. Check the PHP version used by the command line

AtroCore needs PHP 8.4. The version used by Apache can differ from the one used by cron.

php -v which php

The first command must show 8.4.x. If php is a different version, use the full path of the 8.4 binary in the crontab, for example /usr/bin/php8.4.

2. Install the crontab for the web server user

The crontab must belong to the web server user (www-data on Debian/Ubuntu), not to root.

sudo crontab -e -u www-data

Add this single line and replace the project path with yours:

          • /usr/bin/php /var/www/my-atrocore-project/console.php cron

Use absolute paths, and keep the word cron at the end. Save and close the editor. Check that it was saved:

sudo crontab -l -u www-data

3. Run the command once by hand as the same user

This shows the real error if there is one:

sudo -u www-data /usr/bin/php /var/www/my-atrocore-project/console.php cron

It should end without errors.

Please also make sure that exec is not listed in disable_functions in that file. AtroCore uses exec to start its daemons.

4. Check that the daemons are running

Wait one or two minutes after saving the crontab, then run:

ps -aux | grep php

You should see lines like these (the last word is the application ID of your installation):

www-data … php console.php daemon pt www-data … php console.php daemon job-manager www-data … php console.php daemon composer

If job-manager and pt are in the list, everything is working. If nothing appears, cron is not running the command. Check that the cron service is active and whether it logs an error:

sudo systemctl status cron grep CRON /var/log/syslog | tail

5. Common reasons it does not start

  • The crontab was created for root, or with a wrong project path.
  • The CLI uses an older PHP version than 8.4.
  • The files in the project folder do not belong to the web server user, so it cannot write to data/ or public/data/ (make sure this folder exists). Fix it with sudo chown -R www-data:www-data /var/www/my-atrocore-project.
  • A system update is running or was interrupted. In that case the file public/data/composer.log exists, and the cron command stops silently until the update has finished. Check with ls public/data/composer.log.

If it still does not work, please send us:

  1. the output of php -v, sudo crontab -l -u www-data and ps -aux | grep php,
  2. the exact error message (a screenshot is fine), and
  3. the last lines of data/logs/ in the project folder.

Best regards

ok now the cron is nice because I put php8.4 in the command line.
But I’ve got this 500message error few minutes after launching export feed in json:
and in log file
process /usr/bin/env(2229553) exit(idle timeout), terminated by calling exit(), return code: 255
but I don’t konw where is the problem

thank you for your help

when I put display error = on I’ve got this error in log file:
Log.ERROR: Uncaught Exception Laminas\HttpHandlerRunner\Exception\EmitterException: “Unable to emit response; headers already sent in /home/anguis/www/atrocore15/vendor/atrocore/atrocore-legacy/app/Espo/Core/Utils/File/Unifier.php:50” at /home/anguis/www/atrocore15/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php line 16 {“exception”:“[object] (Laminas\HttpHandlerRunner\Exception\EmitterException(code: 0): Unable to emit response; headers already sent in /home/anguis/www/atrocore15/vendor/atrocore/atrocore-legacy/app/Espo/Core/Utils/File/Unifier.php:50 at /home/anguis/www/atrocore15/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:16)”}