这是我的 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