Created
May 5, 2017 16:37
-
-
Save emulsion-io/ded8ab38f5a93f98b1365ecc30ac5a2c to your computer and use it in GitHub Desktop.
Exécute un script python sans paralyser php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start() ; | |
$cmd1 = 'python -u /var/www/blabla/test/Test.py'; | |
$proc=proc_open($cmd1, | |
array( | |
array("pipe","r"), | |
array("pipe","w"), | |
array("pipe","w") | |
), | |
$pipes); | |
$proc_status=proc_get_status($proc); | |
exec('kill -9 '.$proc_status['pid']); | |
proc_close($proc); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment