doudou20145 2017-06-07 15:55
浏览 81
已采纳

位于linux服务器上的PHP代码需要运行windows .exe

The project I am apart of uses a Linux server to host our code. The API I was provided to use was only usable within C#, so currently I have a Windows executable that performs a small task. This executable is called to execute by a PHP file from a website.

Currently, I am attempting to run the file remotely from the Linux server by letting the Windows executable reside on a server running Windows and doing a remote execute call using http://php.net/manual/en/features.remote-files.php, but even if this works, it doesn't seem like a safe or correct way to do things.

A senior suggested I use an IIS server to call it securely, but I am not familiar with this. Before continuing, I thought it would be responsible to ask: is there is a way to have this PHP code residing on a Linux server to run a Windows executable without having to call a remote Windows server for it to run on.

  • 写回答

1条回答 默认 最新

  • douxi3085 2017-06-07 16:01
    关注

    You could write a small web API to run on your Windows server, that after authenticating the request will allow you to execute certain commands locally. Your application running on the linux server could then send requests to this web API and either wait for the results to be returned in that request, or have the Windows server send the results back in an API request later.

    The other option which is arguably simpler... just host the entirety of your application on the Windows server.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器