I'm using process to run command in my code
$commandRaw = 'php artisan mytest:testCommand p1 p2 > /dev/null 2>&1 &';
$commands = explode(' ', $commandRaw);
$process = new Process($commands);
$process->run();
return $process->getOutput();
But when running, I was received error message
Could not open input file: artisan
My artisan path is D:/src/parent/laravel_api/artisan, so I tried to replace artisan in command by this path, but It didn't work
However, when I using cmd to run php D:/src/parent/laravel_api/artisan mytest:testCommand p1 p2 > /dev/null 2>&1 &
, It worked
How can I define artisan path in code?