Having trouble executing Python program in PHP

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 18:09:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!