dongquan8753 2016-08-16 07:31
浏览 245

如何在php中使用spark提交执行python脚本?

I am working on an PHP application using MongoDB as a database platform. Collection in MongoDB has massive volume of data .Hence I have opted for Apache Spark to generate analytics.

I need to execute spark-submit command from PHP application.But its execution doesn't return any output to PHP application.

Following is code snippet

$result=shell_exec('./bin/spark-submit examples/src/main/python/pi.py'); 
print_r($result);

Please suggest me an appropriate solution

  • 写回答

1条回答 默认 最新

  • dpprx26000 2016-08-16 17:39
    关注

    Besides ensuring the Python script is outputting data, if you bang your head against the wall for too long you could consider using the Python script to put data into a database or file to be pulled from by PHP.

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料