我有 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?有没有人有任何想法来实现这种情况?
谢谢你。