Running Python Script in Laravel

Execute python file in Laravel and save data into DB

To troubleshoot your problem, please check the exception. By default, it doesn't show any underlying errors.

if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}

Don't forget to include,

 use Symfony\Component\Process\Exception\ProcessFailedException;

How to run python script with Laravel's command fire method?

try PHP exec function: http://php.net/manual/en/function.exec.php

exec('C:\Python34\python H:\myapp\app\python\questionPopulator.py');


Related Topics



Leave a reply



Submit