Using curl with Phalanger

拈花ヽ惹草 提交于 2020-01-04 05:40:10

问题


I'm trying to use the PHP Phalanger curl library php_curl.mng.dll in a .NET application. I set up my App.config as follows:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <phpNet>
    <classLibrary>
      <add assembly="php_curl.mng, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4ef6ed87c53048a3" section="curl" />
    </classLibrary>
  </phpNet>
</configuration>

and am trying to call curl_init() in C#:

  PHP.Library.Curl.curl_init();

The code compiles with no errors but an exception gets fired when reaching the instruction:

  PHP.Core.PhpException: Call to undefined external function 'curl_init', extension 'php_curl' - check configuration.

Would someone know what I am missing?

Thank you,

Eric.


回答1:


Actually I just found the solution in this thread http://phalanger.codeplex.com/discussions/1345

See the post by ladaprosek and the need to copy App.config to the target directory.



来源:https://stackoverflow.com/questions/1707053/using-curl-with-phalanger

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!