doubo3384 2014-03-13 16:40
浏览 107
已采纳

带有PHP5的PC / SC,带有wampServer的Windows

I'm trying to read public data from smartCard with wampServer, PHP 5.4, winSCard and php_pcsc.dll for PHP5 (http://pecl.php.net/package/pcsc/0.2/windows).

I found this project http://hanez.org/pcsc-for-php.html (code is for php4 but my dll is for php5) and tried to do in localhost but php throws me this error "Call to undefined function SCardListReaders()".

When I see de phpinfo I can see the extension enabled but it hasn't any information (I can't put images because I haven't points), only has table headers

      PC/SC

| PC/SC support | enabled |


Thank you

  • 写回答

1条回答 默认 最新

  • drjv5597 2014-03-13 16:53
    关注

    You may be getting an error because the function is actually scard_list_readers() not SCardListReaders() as the error shows in your post.

    But before you can use most of the functions, you need to establish a context first.

    Try:

    $context = scard_establish_context();
    $readers = scard_list_readers($context);
    
    print_r($readers);
    
    // then when you have your card reader's identity from $readers
    
    $connection = scard_connect($context, 'YOUR CARD READER HERE');
    $response   =  scard_transmit($connection, 'pdu string');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下