laravel - Long running remote script ( PHP to Python) -
i have created site in laravel.
where use below code result external python script.
$ssh = new \phpseclib\net\ssh2("11.111.11.11", 22); ignore_user_abort(true); set_time_limit(0); $ssh->settimeout(0); $result = $ssh->exec("python /url_to_remote_python_file $site $keywords ", $output, $ret_code);
if array takes arround 3 minutes complete works fine.
i found out problem php call hanging long time, when python script has finished not sending php call hangs, how can be?
but when request larger array python script timeout below code.
502 bad gateway nginx 1.8.0
i tried follow link prevent nginx 504 gateway timeout using php set_time_limit() still getting 502 bad gateway when calling exsternal python script, can exsternal server problem?
i whould make work manualy before making run cron job, whould @ possible.?
i have tried put script in laravel queue system. there works if script runs 3 minutes. if script runs for, lets 10 minutes queue listener , log doesn't return me.
how can call python script php , make sure result back.
i need run script every night @ around twelve clock populate database when new results, need make work manualy first.
what best way make happen?
your problem web server. if script supposed run cron job, don't need web server, write command-line script (using php-cli).
Comments
Post a Comment