Is it possible to embedd PHP as a scripting language into a desktop application
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.
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/
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
Potentially yes, although it is likely to be a hack.
There's also embeddable PHP runtime PH7 if you don't mind its GPL-like-or-commercial license.
精彩评论