How to embed php script into c++ application?

Discussion in 'PHP' started by burek, Nov 26, 2008.

  1. #1
    Hi,

    A simple question. If I have one application, written in c++, is there any way I can implement a php scripting support, so the users of that application can write scripts in php, that my application can understand and execute.

    So, shortly, my goal is to embed php scripts into my application (something like python/perl/lua scripting support, but with php).

    Is this even possible?
    If it is, please give me as much links and informations possible, because google didn't help a lot.

    Thanks a lot whoever helps on this.
    burek
     
    burek, Nov 26, 2008 IP
  2. alpha42

    alpha42 Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Lua I believe is a library, meant to be embedded into a larger app.. I'm not aware of a library version of php out there, so the closest thing I can think of would be to do a system("php") and force-feed it the php code and capture the results.

    My c++ is rusty, so I can't think of how you'd do this off hand, but I imagine it could be done.. might not be the fastest/cleanest/best method, but offhand it's the only thing that's popping into my head.
     
    alpha42, Nov 26, 2008 IP