I have a C# application that needs to call a PHP script, and get the output, in the fastest possible way. The options I explored:
- Executing the script with PHP CLI (Pro: Easy / Cons: No Opcode Cache / Precompilation ]
- Compiling the PHP (Phalanger, Hiphop, etc.) [Pro: No Webserver / Con: Compatibility ]
- Using an embedded webserver (AppWeb, Cherokee, Lighttpd) [Pro: Simple / Cons: Deployment ]
Are there any other options left?
EDIT: The best possible option would be to make use of the build-in FastCGI server of PHP, by running php-cgi.exe -b 127.0.0.1. But there seems no (C#) code to talk to a server available. While there are so many server-side libraries (like FCGIDotNet and SharpCGI), they all implement the server-side of the protocol.
<?php ?>via CLI here is essentially instantaneous.