Promag读卡器PHP访问


Promag Card Reader PHP Accessing

我有promag 310读卡器。它是用com端口连接到PC的。我想在windows平台上用PHP xamplep访问卡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?有人有任何想法来实现这种局面吗?

谢谢。

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

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