This topic is locked
[SOLVED]

Call to undefined function exec()

10/19/2024 7:43:22 PM
PHPRunner General questions
H
headingwest author

Hi All,

I'm trying to run a php file for async reasons. The following works in a cron job but not when I call it from PHPRunner.

This code is inside a .php file:

function startmoderation(){
exec('php ./php/moderation.php > /dev/null 2>&1 &');
}

Fatal error: Uncaught Error: Call to undefined function exec()

Any ideas? Thanks.

D
DRCR Dev 10/20/2024

Exec is disabled by default in most php installations. Just enable it.

H
headingwest author 10/20/2024

Thanks DRCR Dev, that fixed it.