I'm trying to launch a julia program from a drupal website (running on xampp for Windows), it needs to run asynchronously in the background while the php script continues execution. This is the code I'm trying to use:
$juliaFile = escapeshellarg(DRUPAL_ROOT . '/sites/all/modules/tsap/Modeling/runme.jl');
$cmd = "start /B julia $juliaFile";
pclose(popen($cmd, 'r'));
This code works perfectly if I run it through a command line php script, but it doesn't work when it runs through apache, however, the next bit of code works both from command line and from the webserver (The only difference is running a php script instead of a julia program)
$phpFile = escapeshellarg(DRUPAL_ROOT . '/sites/all/modules/tsap/Modeling/runme.php');
$cmd = "start /B php $phpFile";
pclose(popen($cmd, 'r'));
I've also tried calling the first block of code within a php file that gets execute by the webserver, which also succeeds from the command line, and fails when the server attempts to execute it.
I also get issues using backtick operators and exec()
(they block on the call) and using COM::run()
results in the same issue as pclose(popen())
Does anyone have any ideas for getting the julia call to work?
Thanks for your time