doulian8485 2013-06-15 20:52
浏览 89

在另一台服务器上执行php文件

I'm using Amazon EC2 to host a website, with the aim of having the smallest instance possible to save on costs etc.

Part of my website has a php function that unzips an archive full of mp3's, then rezips them and moves it all to Amazon S3 storage.

That particular function is very resource hungry on the micro EC2 instance that we're running. So, we've setup another server (running Gluster) just for storing temp files and processing these temp files.

The problem i have now is how do i move over the previously mentioned function to the 'processing' server and trigger it to run from the 'main' server?

I want to have something like the below:

Publish post on main server -> Send command to processing server to execute unzip etc -> process -> return any required information from processing server back to main server

Hopefully that all makes sense. Unfortunately, my PHP knowledge is basic, and my server knowledge is even less... but i'm willing to learn ;)

  • 写回答

1条回答 默认 最新

  • dsaf415212 2013-06-15 20:56
    关注

    Create another site on the other server that doesn't have any pages but is just accessed through web service requests, like REST.

    Check out a framework like Symfony2 to set this up easily.

    Have your main server page call a web service and pass through the information (zip, etc) it needs and you web service can execute the process on the process server.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看