Fork me on GitHub

Jexus以.NET(Phalanger)方式支持PHP的网站

Jexus可以同时用普通方式(PHP-CGI/PHP-FPM)以及.NET(Phalanger)方式支持PHP,为了不引起混淆,用.NET方式支持PHP时,要注意如下事项:
1、网站配置文件中的UsePHP的值为false,或者不用这一句。
2、网站配置文件中添加一行 ASPNET_Exts=php,说明php网页按ASP.NET处理,如果已经有这一项,就在末尾添一个php(用英文件逗号与已有扩展名分隔)。
3、Jexus启用.NET4工作模式(在jws.conf中添一行“Runtime=v4.0.30319”)。
4、在网站的web.config添加Phalanger有关配置。

在“<configuration>”下添加:
  <configSections>
    <section name="phpNet" type="PHP.Core.ConfigurationSectionHandler, PhpNetCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0a8e8c4c76728c71" />
  </configSections>

  <phpNet>
    <compiler>
      <!-- <set name="Debug" value="true" /> -->
    </compiler>
    <paths>
      <set name="DynamicWrappers" value="/tmp" />
      <set name="Libraries" value="Bin" />
    </paths>
    <classLibrary>
      <add assembly="PhpNetClassLibrary, Version=3.0.0.0, Culture=neutral, PublicKeyToken=4af37afe3cde05fb" section="bcl" />
    </classLibrary>
  </phpNet>

在"system.web"中添加:
<httpHandlers>
  <add path="*.php" verb="*" type="PHP.Core.RequestHandler, PhpNetCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0a8e8c4c76728c71" />
</httpHandlers>

具体的配置实例参照 MVC3+RAZOR+PHP.NET 网站基础包

使用Phalanger整合PHP和.NET

posted @ 2013-05-04 20:50  张善友  阅读(1050)  评论(0编辑  收藏  举报