Run Flarum's scheduler without proc_open — for shared hosting that disables it
composer require linkrobins/metronome
Then enable it in your forum's admin panel under Extensions.
Keeps Flarum's scheduled tasks ticking on shared hosting. Many shared
hosts disable PHP's proc_open function, and Flarum's scheduler depends on
it: every scheduled task is launched as a separate process. Metronome adds a
schedule:run-inline command that runs the exact same schedule inside the
one PHP process your cron job already starts, so nothing needs proc_open
at all.
On hosting with proc_open disabled, php flarum schedule:run looks fine:
it exits cleanly, and the admin dashboard even reports the scheduler as
active. But no scheduled task ever actually runs. The only trace is a line
buried in the log for every task, every minute:
The Process class relies on proc_open, which is not available on your PHP installation.
So extensions that clean up, sync, or aggregate on a schedule quietly do nothing, and it looks like their bug.
schedule:run-inline walks the same schedule as schedule:run and keeps
the same behaviour wherever that is possible without launching processes:
withoutOverlapping() locks are honoured, and are compatible both ways
with locks taken by the stock runner.onOneServer() is honoured.sendOutputTo() /
appendOutputTo() output capture all work.Two things cannot be identical without proc_open, and the command is
upfront about both instead of skipping work silently:
runInBackground() runs in the foreground instead,
with a warning in the output. It still runs.exec() cannot run at all
without launching a process. It is reported as a failed task rather than
ignored.If your hosting does have proc_open, keep using the stock
schedule:run. This extension is for the hosts where that is not an option.
Flarum 2.0 only. There is no build for Flarum 1.8.