The actual scenario is: already have a relatively complex program written in C # (non-WEB programs, implementation of some algorithms), now there is a PHP website, I need to embed this C # application in the PHP Web page to use. Search a lot of results, all said compiled into a DLL for PHP call, but the Web application needs to be compatible with Linux and Windows system, if you use dll,linux it seems not possible. What better way to ask the gods, to kneel and thank
Reply to discussion (solution)
External programs that can be called by PHP must not have user interaction (users may not be able to run to your server to click the mouse or press a few keys)
So it's not wrong to compile into a DLL.
As for the ability to run C # programs in Linux, it is said to be possible, but what software to install
However, C # needs to run in the. NET environment, which is much less efficient than C + +. Since you can write in C #, why not use C + +? There's no interface anyway, and C # 's advantage is gone.
External programs that can be called by PHP must not have user interaction (users may not be able to run to your server to click the mouse or press a few keys)
So it's not wrong to compile into a DLL.
As for the ability to run C # programs in Linux, it is said to be possible, but what software to install
However, C # needs to run in the. NET environment, which is much less efficient than C + +. Since you can write in C #, why not use C + +? There's no interface anyway, and C # 's advantage is gone.
Thank you for the answer on the first floor. Well, I'm just doing two development of the existing PHP system, and I'm going to need to embed the algorithm that someone else has developed (C #) into the application. The algorithm is quite complex, the rewriting is not very practical, and requires new research to replace the algorithm module.
PHP must be with C # write the algorithm between the parameters, and get back the results, I also saw that Linux to install a certain software can be used, but very unstable, a lot of defects.
As a second-hand program ape, I can only say that I will add a Web interface in C #, take the algorithm a little time to change the HTTP protocol API, return the JSON, and then use PHP's curl to call, simple rude
Then you don't have to take care of Linux, honestly working in Windows
Estimates can't be realized, C # that thing don't want to cross the platform AH.
C # provides interfaces Ah
Interacting with HTTP + json and PHP
C # is more troublesome in Linux. Let's get a different idea.
Write a Web in C # and then use HTTP to access the call.
Then you don't have to take care of Linux, honestly working in Windows
Thank you moderator, search a lot of information, finally can only this, like you said only consider Windows system it. Now can only be made compatible with other modules, this module is only for Windows, the completion of the completed on time is more important, thank you
As a second-hand program ape, I can only say that I will add a Web interface in C #, take the algorithm a little time to change the HTTP protocol API, return the JSON, and then use PHP's curl to call, simple rude
Yes, thank you, the train of thought is very detailed.