views:

51

answers:

3

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.

+1  A: 

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/

hopeseekr
A: 

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

Ignacio Vazquez-Abrams
A: 

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

timdev