这是我的php文件中的问题:
$eventid_arg = $_REQUEST['eventid'];
$pyresponse_str = system('python s_scrape.py $eventid_arg', $retval);
我已经为s_scrape.py做了以下事情:
1- placed it in the same localhost folder as the php file.
2- chown changed to www-data:www-data
3- chmod changed to 777 on both the .py and .pyc
4- made sure '#!/usr/bin/env python' is on the python file
答案 0 :(得分:1)
我可能稍微离开这里,但也许:
$pyresponse_str = system('python s_scrape.py $eventid_arg', $retval);
只需要双引号即可识别$ eventid_arg?
$pyresponse_str = system("python s_scrape.py $eventid_arg", $retval);
答案 1 :(得分:0)