Search code examples
phpsmartcardpcsc

Promag Card Reader PHP Accessing


I have promag 310 card reader. It is connect to PC with com port. I want to access card ID with PHP xampp in windows platform. I add php_pcsc.dll to extension folder. And I update php.ini with it. then I wrote this code:

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

But PHP returns:

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

So I did not access card reader. How can I access card ID with PHP? Does anybody have any idea to achieve this situation?

Thank You.


Solution

  • As I am the developer of the PHP extension for accessing smartcards, I can say you are doing everything right. It seems your card reader is not supported. I use an Omnikey 5321 and SCM SCL011 for accessing smart cards and they work just fine.

    Since you are using Windows I can not try check what possibly goes wrong.