calling dll through php

我只是一个虾纸丫 提交于 2020-01-03 02:48:08

问题


I need to call a dll that returns a string using PHP.
What would be the best possible way to achieve this?


回答1:


Build a PHP extension that wraps the DLL or create a wrapper (in any language) that can be accessed via shell with exec.




回答2:


This is not possible using native PHP.

I would look into running an operating system level function to do this using exec(), like for example rundll.exe (for some kinds of DLLs).

If rundll can't do it (it has something to do with managed and unmanaged DLLs, I don't know what that means), the easiest way may be writing a wrapper application that imports the DLL, performs the necessary actions, and outputs the result.



来源:https://stackoverflow.com/questions/4368058/calling-dll-through-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!