I am trying to build a system in Laravel from which I am able to call some python scripts. Starting with https://github.com/maurosoria/dirsearch, I have placed the python script with the same machine and tried to run on api call.
If I run shall_exec('ls -la');
it runs perfectly and returns me result.
But when I run the following command, the execution ends and no output.
shall_exec("python3 dirsearch-master/dirsearch.py -u https://www.yahoo.com/ -e *");
Then I used https://symfony.com/doc/current/components/process.html and try the same steps
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
$process = new Process("python3 dirsearch-master/dirsearch.py -u https://www.yahoo.com/ -e *");
$process->run();
// executes after the command finishes
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
echo $process->getOutput();
In this case also the $process->run();
returns me no result.