简体   繁体   English

如何从另一台服务器运行php文件?

[英]how to run a php file from another server?

i am trying to do a video converter that grabs some files from a html form and converts them. 我正在尝试做一个视频转换器,可以从html表单中获取一些文件并将其转换。

i would like to do the conversion on another server, .11 , since i don't want to overload the main server .10 我想在另一台服务器.11上进行转换,因为我不想使主服务器.10过载.10

i can set up a network folder between the two servers, /media , and have a convert.php on .11 that will run the ffmpeg command. 我可以在两个服务器/media之间设置一个网络文件夹,并在.11上运行convert.php并运行ffmpeg命令。

if i run that php file from .10 then will the video conversion process take resources from .11 or from .10 ? 如果我从.10运行该php文件,那么视频转换过程会从.11还是.10获取资源? Seems to me that .10 will be affected even if the php file is on .11 . 在我看来,即使php文件位于.11上, .10也将受到影响。

I could do a cron job, but i really don't want to. 我可以做一个计划工作,但我真的不想这么做。

For this project i am using zend framework 对于这个项目,我正在使用zend框架

Any ideas how to solve this issue? 任何想法如何解决这个问题?

thanks 谢谢

I would definitely recommend implementing a Queue for these kind of tasks. 我绝对会建议为此类任务实现一个队列。 Your queue could be simply a MySQL database that maintains a list of outstanding tasks. 您的队列可能只是维护一个未完成任务列表的MySQL数据库。 The workers can check this database for any tasks to be run. 工人可以检查此数据库中是否有任何要运行的任务。

This will provide you with far more flexibility in terms of scaling up. 在扩展方面,这将为您提供更大的灵活性。 Tomorrow, if you decide to add two more worker servers/systems, they will fit seamlessly into the queue-model. 明天,如果您决定再添加两个工作服务器/系统,它们将无缝地放入队列模型中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM