有什么方法可以将asp.net与php集成。

时间:2022-12-02 10:37:09

I know that ASP.NET Application can run with PHP application on IIS through fastCGI, but is there any way to integrate both application, so that i can utilize codes from php and Asp.net working together.

我知道ASP.NET应用程序可以通过fastCGI在IIS上运行PHP应用程序,但有没有办法集成这两个应用程序,这样我就可以利用php和Asp.net协同工作的代码。

during my research I found a third party tool known as Phalanger that converts the php code into MSIL and runs with .net application but the problem what i have is that it is in beta version and sessions_start() function is not running properly. Any other good ideas??? if so please let me know.

在我的研究中,我找到了一个名为Phalanger的第三方工具,它将PHP代码转换为MSIL并使用.net应用程序运行但我遇到的问题是它处于测试版并且sessions_start()函数运行不正常。任何其他好主意???如果是的话请告诉我。

1 个解决方案

#1


0  

It sounds like you are looking to have a single document which contains both the language types running side by side.

听起来你正在寻找一个包含并排运行的语言类型的单个文档。

I do not believe it would be possible using your standard resources from php.net and Microsoft. As you've mentioned, there may be tools to convert the code but the success may vary (I'm unable to advise of any myself).

我不相信使用php.net和Microsoft的标准资源是可能的。正如您所提到的,可能存在转换代码的工具,但成功可能会有所不同(我无法建议自己)。

In IIS you'd configure an Application Extensions against file extensions. For example .ASPX against aspnet_isapi.dll or .PHP against php5_isapi.dll.

在IIS中,您将针对文件扩展名配置Application Extensions。例如.ASPX针对aspnet_isapi.dll或.PHP针对php5_isapi.dll。

You would need to have the same application extension in twice against two ISAPI extensions and IIS will not allow you to do this.

对于两个ISAPI扩展,您需要两次使用相同的应用程序扩展,IIS将不允许您执行此操作。

As for Apache, as it's text based it would obviously allow for setting this but will likely not work as desired.

至于Apache,因为它基于文本,显然可以设置它,但可能无法按预期工作。

Even if this was to work I would also consider it a bad idea as you'd be likely encounter other problems down the line.

即使这是工作,我也会认为这是一个坏主意,因为你可能会遇到其他问题。

I would suggest you look at an cart application built in ASP.NET rather than trying to merge two different languages together that are typically not built for this function.

我建议你看一下用ASP.NET构建的购物车应用程序,而不是试图将两种不同的语言合并在一起,这些语言通常不是为这个函数构建的。

#1


0  

It sounds like you are looking to have a single document which contains both the language types running side by side.

听起来你正在寻找一个包含并排运行的语言类型的单个文档。

I do not believe it would be possible using your standard resources from php.net and Microsoft. As you've mentioned, there may be tools to convert the code but the success may vary (I'm unable to advise of any myself).

我不相信使用php.net和Microsoft的标准资源是可能的。正如您所提到的,可能存在转换代码的工具,但成功可能会有所不同(我无法建议自己)。

In IIS you'd configure an Application Extensions against file extensions. For example .ASPX against aspnet_isapi.dll or .PHP against php5_isapi.dll.

在IIS中,您将针对文件扩展名配置Application Extensions。例如.ASPX针对aspnet_isapi.dll或.PHP针对php5_isapi.dll。

You would need to have the same application extension in twice against two ISAPI extensions and IIS will not allow you to do this.

对于两个ISAPI扩展,您需要两次使用相同的应用程序扩展,IIS将不允许您执行此操作。

As for Apache, as it's text based it would obviously allow for setting this but will likely not work as desired.

至于Apache,因为它基于文本,显然可以设置它,但可能无法按预期工作。

Even if this was to work I would also consider it a bad idea as you'd be likely encounter other problems down the line.

即使这是工作,我也会认为这是一个坏主意,因为你可能会遇到其他问题。

I would suggest you look at an cart application built in ASP.NET rather than trying to merge two different languages together that are typically not built for this function.

我建议你看一下用ASP.NET构建的购物车应用程序,而不是试图将两种不同的语言合并在一起,这些语言通常不是为这个函数构建的。