是否可以将 PHP 作为脚本语言嵌入到桌面应用程序中

发布于 2024-09-16 18:11:39 字数 134 浏览 2 评论 0原文

我知道我的客户了解 PHP,因为我正在开发 PHP 工具(作为 MFC 桌面程序运行)

是否可以以 Python、Ruby、Lua 或 Javascript 等通用方式嵌入 PHP 解释器?如果是的话 - 是黑客攻击还是有干净的解决方案。

I know that my customers know PHP because i'm working on a PHP Tool (Running as a MFC Desktop Program)

Is it possible to embedd the PHP interpreter in a general purpose way like Python, Ruby, Lua or Javascript? And if yes - is it a hack or is there a clean solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

忆依然 2024-09-23 18:11:39

你能用 PHP-GTK 重写语言吗?这就是我制作 Win32 PHP 应用程序的方式。

如果您运行的是 .NET,那么您需要查看 Phlanager,那么答案肯定是肯定的。

最后,有各种 PHP 编译器可以将 PHP 代码编译成您的应用程序可以在本机使用的 DLL。请参阅:http://phpcompiler.org/

Can you rewrite the language using PHP-GTK? That's how I make Win32 PHP apps.

If you're running .NET, then you need to check out Phlanager, and then the answer is definitely yes.

Finally, there's various PHP compilers that can compile PHP code into DLLs that your apps can use natively. see: http://phpcompiler.org/

奈何桥上唱咆哮 2024-09-23 18:11:39

看来最先进的技术需要一些黑客技术。

您可以从源代码编译 php,并将 --enable-embed=[shared|static] 传递给 configure

显然,这并不是那么简单,但 facebook 的人们显然已经尝试改进它,创建了 phpembed

这2006 年的幻灯片似乎有一些关于使用通过 --enable-embed 创建的库

It appears the state of the art requires some hacking.

You can compile php from source, passing --enable-embed=[shared|static] to configure.

Evidently, that's not all that simple, but the facebook folks have evidently tried to improve it, creating phpembed

This slide deck from back in 2006 seems to have some interesting tidbits on working with the library created via --enable-embed

叫思念不要吵 2024-09-23 18:11:39

可能是的,尽管这很可能是黑客攻击。

Potentially yes, although it is likely to be a hack.

许久 2024-09-23 18:11:39

如果您不介意其类似 GPL 或商业许可证,还有可嵌入的 PHP 运行时 PH7

There's also embeddable PHP runtime PH7 if you don't mind its GPL-like-or-commercial license.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文