whisperwow can you verify that you are targeting the command in the right directory? Did you try running the command manually (not in a cron) to verify it works?
Setup the Flarum scheduler using cron
whisperwow try executing this command without dev null manually and see if you encounter any errors:
cd /home/MY_USERNAME/domains/MY_DOMAIN/public_html/discussions && /usr/bin/php flarum schedule:run
- Edited
luceos I was successfully able to execute the above command (with my username and domain of course) directly from the SSH Command line. However, the cron job still does not work.
- Edited
whisperwow as what user are you executing the command? In your panel.
luceos Not sure I understand your question. When I log into the SSH command line through my Terminal program, I login with the SSH password. No user is specified. When I am in my Hostinger Hpanel, I am logged in as an admin setting up the cronjob. I am the only user on the account.
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?
- Edited
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?
whisperwow i dont see a thing wrong with it. So you might best ask hostinger support about this.
luceos OK thanks for the replies. I'll check again with Hostinger support.
- Edited
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.
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?
- Edited
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.
- Edited
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.
- Edited
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?