php 执行python 脚本文件

WBOY
Release: 2016-06-23 13:24:09
Original
1147 people have browsed it

我这有这么一个php文件:
system('python /home/yangxu/test/providerinfo/smx_sensor.py bl460c-g8-2.test');
echo 'success';
//end php 
?>

如果在命令行执行php temperatureProvider.php,里面的python脚本可以执行;
可是我通过网页运行这个php文件的时候,只输出了‘success’,python脚本没有执行,这个是怎么回事呢,有什么解决办法吗,谢谢高手指教!


回复讨论(解决方案)

执行PYTHON的文件路径 及URL格式都需要检查

bl460c-g8-2.test这个打成全路径试试~

执行PYTHON的文件路径 及URL格式都需要检查


我已经把路径改好了:
system('/usr/bin/python /home/yangxu/test/providerinfo/smx_sensor.py bl460c-g8-2.test');
不过还是没有反应,还会有什么问题吗?

你的问题解决了么???我也遇到了和你同样的问题!!!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!