3

I have gotten Lua scripting in C# working via LuaInterface, and javascript scripting working via JInt. The goal is to support a wide variety of scripting language options. Is there any similar method to run embedded PHP scripts in a similar way?

I.E., have a PHP script in a string, pass it to either the PHP command line or an interpreter of sorts, and capture the output (Ideally being able to hook in to .NET methods).

Looked at IronPHP, but that doesn't seem to have gotten anywhere. Also looked at Phalanger, but am not sure if it can accomplish this. It seems to be more along the lines of "Compile PHP to .NET bytecode".

1
  • I'm not aware of any library (nor have I had anything to do with c# in a long time), but a PHP cli can just read from STDIN, you something like this could easily work. Commented Oct 4, 2010 at 18:13

1 Answer 1

2

I've never heard of anyone embedding PHP into an application and exposing internal methods to scripts in that way. Lua is designed for this use case as was Tcl, and JavaScript has traction there as well. I'd recommend dropping PHP as the effort required is probably not worth it. Python would be a good language to try next.

Sign up to request clarification or add additional context in comments.

1 Comment

Afraid this is true, from what I've found. Unfortunate, but understandable, as PHP was never designed to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.