Scheduling Cron Task without crontab

Hello,

I’m on Version 9.2.0 and PHP 8.1.16.
I have the problem that my hoster does not offer crontab, only webcron.
So I created an executable .php file that runs every minute:

<?php
exec("/usr/bin/php /www/htdocs/xxx/concrete_cms/concrete/bin/concrete concrete:scheduler:run", $out, $result);echo "Returncode: " .$result ."<br>";
echo "Ausgabe des Scripts: " ."<br>";
echo "<pre>"; print_r($out);
?>

But nothing happens there. Does it even work this way?
Maybe someone can help.Thanks a lot
Jens

does the script work on the command line?
if yes, it may be either the perms on the php file or a missing authorization to run command “exec” - my hoster for example ask to specify it as it is disabled by default

Many hosting accounts block the use of exec and similar commands as a security measure. You could check with your host the command is available to you.

“Die Verwendung von Funktionen wie exec(), system() oder shell_exec() ist bei uns möglich.” (…is possible with us.)
Since tonight the error output is also enabled:

Returncode: 127
Ausgabe des Scripts: 
Array
(
)

I keep trying to contact the support team but they are so lazy…

Yes, without problems:

ssh-xxx@yyy:/www/htdocs/xxx$ /www/htdocs/xxx/concrete_cms/concrete/bin/concrete concrete:scheduler:run

#!/usr/bin/env php

Generation of sitemap.xml started.

Sitemap URL available at: https://c5.stelze.at/sitemap.xml

To clarify, I should have noted “exec and similar commands from within php”

These are examples from their docs:

<?php
exec("/bin/bash **Pfad zum Script** 2>&1", $out, $result);
echo "Returncode: " .$result ."<br>";

PHP:
exec("/usr/bin/php **Pfad zum Script** 2>&1", $out, $result);

So that should be the case.

Meanwhile the support has acted and so it works:

<?php

exec("/usr/bin/php74 /www/htdocs/xxx/concrete_cms/concrete/bin/concrete concrete:scheduler:run >> /dev/null 2>&1", $out, $result);

echo "Returncode: " .$result ."<br>";

echo "Ausgabe des Scripts: " ."<br>";

echo "<pre>"; print_r($out);

?>

/usr/bin/php74 works.
Thank you.