问题
I have an Apache web server where I display some graphs in my index.php page, however, these are updated frequently and I use a python program to do it, so I want to be able to run this python file every time my page is refreshed or loaded. I'm trying to use the exec
function in php, but it doesn't seem to be executing the python file. This is the way I'm using the function:
<?php
exec('sudo /usr/bin/python3 ttp.py');
I have this php script at the top of my index.php page.
来源:https://stackoverflow.com/questions/52653576/having-trouble-executing-python-program-in-php