whisperwow the question relates to the cronjob you set up

whisperwow My cronjob is configured to the following format:

cd /home/MY_USERNAME/domains/MY_DOMAIN/public_html/discussions && /usr/bin/php flarum schedule:run >> /dev/null 2>&1

Where exactly is that set up, did you use crontab on the server? If so, as what user?

    luceos I am using the cronjob feature of my Hostinger hosting account. Following is my cronjob with the username displayed:

    cd /home/MY_USERNAME/domains/MY_DOMAIN/public_html/discussions && php flarum schedule:run

    Does that help?

      luceos OK thanks for the replies. I'll check again with Hostinger support.

      whisperwow I'm a bit confused, because that is not the syntax for a crontab.

      The cron job syntax looks like this:
      https://en.wikipedia.org/wiki/Cron#Overview

      I guess you are using some GUI I'm not familiar with:
      https://support.hostinger.com/en/articles/1583465-how-to-set-up-a-cron-job-at-hostinger

      Could you provide a screenshot, just for the sake of clarity?

      Also, don't you have any shell access? If so, can you do "crontab -l" to show your current crontab and "crontab -e" to edit it?

      whisperwow having been responsible over an inhouse developed control panel for over 7 years, I can only be astonished about how user unfriendly this is. But glad you figured it out.

      BeeMeme I suggest you reach out to your hosting provider directly. Perhaps if you share some details on where your community is hosted, we can help you better.

      23 days later

      I've set the cronjob correctly to run every minute, I have the FoF sitemap extension enabled and set to rebuild hourly but on the dashboard I still see "Scheduler - Inactive". It seems to be running, I see the updates in the sitemap.xml. What is wrong?

      6 days later

      whisperwow Sorry to bother you, but could you help me on that ? It doesn't seem to do anything.

      Did you write /usr/bin/php in before the flarum schedule ?
      I have this as the bash script :
      #!/bin/sh
      cd /home/u123456789/domains/example.com/public_html/forum/ && /usr/bin/php flarum schedule:run >> /dev/null 2>&1

      It doesn't seem to do anything. I also have that :
      https://ibb.co/Ks2JLjv

      It somehow works on my Rapsberry Pi or in any Linux machine. But not on Hostinger. I will presumably self host at some extent.

      14 days later

      I have used cPanel to set up the cron job on my hosted site. It runs as scheduled but I get the error message:

      **Composer detected issues in your platform:

      Your Composer dependencies require a PHP version ">= 8.2.0". You are running 7.4.33.**

      But this doesn't seem to be correct. in cPanel I have a PHP Selector which says the current version is set to 8.2. Also, from the Flarum admin dashboard the versions are shown as:

      Flarum 1.8.5
      PHP 8.2.21
      MySQL 10.6.18-MariaDB-cll-lve

      I don't know anything about Composer so would appreciate some help in figuring out what is going on here.

        AndyS

        Ignore me. I didn't fully understand the instructions for setting up the cron job. I had the wrong path to PHP even though the instructions clearly said I might need to play with the path a bit.

        8 months later

        I tried the schedule:run cron job but i receive this error:

        [2025-03-31 15:04:04] flarum.ERROR: Symfony\Component\Process\Exception\LogicException: The Process class relies on proc_open, which is not available on your PHP installation.

        my hosting server does not allow me to have proc_open enabled. Is there any alternative of the cron job that does not rely on proc_open?

          21 days later

          ProudToBeFout Settings -> Scheduled Tasks (Cron jobs) in Tools and Resources -> Add Task Button

          Task type: Run a command

          Command:
          cd /var/www/vhosts/example.com/forum.example.com && sudo -u examplecom /opt/plesk/php/8.2/bin/php flarum schedule:run >> /dev/null 2>&1

          Cron style: * * * * *

          System user: root