0

我有 promag 310 读卡器。它通过 com 端口连接到 PC。我想在 windows 平台上使用 PHP xampp 访问卡 ID。我添加php_pcsc.dll到扩展文件夹。我更新php.ini了它。然后我写了这段代码:

$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');

但是PHP返回:

resource(2) of type (PC/SC Context) NULL

所以我没有访问读卡器。如何使用 PHP 访问卡 ID?有没有人有任何想法来实现这种情况?

谢谢你。

4

1 回答 1

0

由于我是用于访问智能卡的 PHP 扩展的开发人员,我可以说您做的一切都是正确的。好像不支持你的读卡器。我使用 Omnikey 5321 和 SCM SCL011 来访问智能卡,它们工作得很好。

由于您使用的是 Windows,因此我无法尝试检查可能出现的问题。

于 2015-03-18T14:30:33.950 回答