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 th
Try removing the $mystring; line
function success() {
$mystring = exec('python testing.py');
if(!$mystring){
echo "python exec failed";
} else {
echo "
";
echo "successfully executed!";
}
}
For testing purposes try:
function success() {
$mystring = exec('python testing.py', $output);
var_dump($output);
}