Page 1 of 1

Got a DLL, not sure what to do next

PostPosted: February 15th, 2015, 7:42 pm
by fromin
Pardon my ignorance, I've been a PHP developer for 10 years, but know absolutely nothing about .NET, so even with the help of the documentation, I wasn't able to figure this out.

I would like to use Phalanger as a way to protect my commercial script's source cod.

Is it possible to generate a CGI executable so that the DLL behaves as the original project or am I completely misunderstanding something here?

If it is possible, how? If not, what is the easiest way to get it working (obviously I need a standalone file which doesnt require any server modifications, since it's a script that will be used on many various webhosts, some of which will not allow any uncommon configuration modifications)?

Re: Got a DLL, not sure what to do next

PostPosted: February 16th, 2015, 1:12 pm
by Jakub Misek
Hello,

It is possible to build .NET DLL without PHP source files; as console EXE application or as ASP.NET web site (to be used on IIS web server).

In addition to your compiled code, you have to bundle it with Phalanger runtime DLLs.

Re: Got a DLL, not sure what to do next

PostPosted: February 17th, 2015, 9:33 am
by fromin
Thank you. I was actually able to build EXE for "hello world!", rename it from .exe to .cgi and ran it in browser, but it takes insanely long to execute the script (300 ms for "hello world" in CGI when compared to 4 ms in PHP). Is there anything I can do about it?

Re: Got a DLL, not sure what to do next

PostPosted: February 22nd, 2015, 9:32 am
by Jakub Misek
I would not rename file extensions ... anyway, this approach results in EXE being started for every web request over and over ... since .NET (and so Phalanger) has significant overhead during startup, you'll experience long page load.

Phalanger performs best when you build regular web project on top of ASP.NET and IIS Integrated Pipeline (ASP.NET 4 default). In this way, you'll have single DLL with all the .php script files which you can, together with web.config and Phalanger runtime binaries, deploy anywhere on IIS.