I have a simple PHP function that is supposed to execute a Pyton script when its called. I have tried this sort of function multiple times in my php programs, but somehow this time this function is not executing the python script at all. When I access the script from the command prompt and run python testing.py
then it successfully gets executed. One thing that I want to mention that this script has some serious implementations of python's NLTK library, and takes more than 20 seconds to execute and perform its operations (i.e. data process and storing to db). Is this delay in the execution which is causing this problem or is there something else that I am missing this time?
function success(){
$mystring = exec('python testing.py');
$mystring;
if(!$mystring){
echo "python exec failed";
}
else{
echo "<br />";
echo "successfully executed!";
}