python - How can I get shell_exec to run on my server?

So I know there are plenty of similar questions on the site, but I can't find any answers that explain clearly enough a solution to my problem. Hopefully a clear answers to this could help many others!
I've got two files, test.php and test.py.
test.php
<?php
$output = shell_exec('test.py');
echo $output;
?>
test.py
print("hello, world")
PHP prints "hello, world" on localhost, but not on the server (Unix, I think), where everything is blank. I can successfully run test.py on the server with the command line, and have checked function_exists('shell_exec') in PHP, which it does.
I understand that I might need to give the server permission to use shell_exec, but this is where I get a bit confused. Any help would be much appreciated, thank you!
Answer
Solution:
So I finally solved this. Turns out
$output = exec('python test.py');
does the job. Thanks to Lawrence for the pointer!
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: cannot add or update a child row: a foreign key constraint fails
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.