How to run an python file on php script on web server?
Get the solution ↓↓↓I am trying to host a website running on php calling a python script on web server.
The web server name (Host) is heroku.com whenever I try to execute my python script with php it does not work (execute).
I think the code itself is little much wrong.
below is the php code for calling python file - forphp.py
$command = escapeshellcmd('forphp.py');
$py = shell_exec($command);
Answer
Solution:
you almost have it
$cmd = "python forphp.py"
shell_exec($cmd);
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: 403 this action is unauthorized.
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.