pcsc-for-php / pcsc Goto Github PK
View Code? Open in Web Editor NEWAn implementation of the PC/SC SCard API for PHP.
Home Page: http://pecl.php.net/package/pcsc
License: Other
An implementation of the PC/SC SCard API for PHP.
Home Page: http://pecl.php.net/package/pcsc
License: Other
I switched to PHP 8.0.3 today for testing but it seems that the extension is not working there. In 7.4.16 everything works as expected. Does someone have an idea what could be wrong here?
hanez@jupiter [master] examples # php -dextension=pcsc simple.php
Warning: Module "PC/SC" is already loaded in Unknown on line 0
>> Create Context
resource(4) of type (PC/SC Context)
int(0)
string(15) "SCARD_S_SUCCESS"
>> Get Readers
array(2) {
[0]=>
string(38) "OMNIKEY CardMan (076B:5321) 5321 00 00"
[1]=>
string(38) "OMNIKEY CardMan (076B:5321) 5321 00 01"
}
int(0)
string(15) "SCARD_S_SUCCESS"
>> Select Reader
Using reader: OMNIKEY CardMan (076B:5321) 5321 00 01
int(0)
string(15) "SCARD_S_SUCCESS"
>> Connect to Card
Fatal error: scard_connect(): Return value must be of type array|false, resource returned in Unknown on line 0
hello
i want to get uid smart card
But I do not know how to set $apdu ?
What is the required amount to receive uid?
example: $apdu = "";
Please help me set the appropriate value for the $ apdu variable instead
thanks.
cardreader : duali dragon
Git head gives these errors at the moment:
pcsc_arginfo.h(73): error C2065: 'arginfo_scard_begin_transaction': undeclared identifier
pcsc_arginfo.h(74): error C2065: 'arginfo_scard_end_transaction': undeclared identifier
pcsc_arginfo.h(73): error C2099: initializer is not a constant
pcsc_arginfo.h(73): warning C4047: 'initializing': 'const _zend_internal_arg_info *' differs in levels of indirection from 'uint32_t'
pcsc_arginfo.h(74): error C2099: initializer is not a constant
pcsc_arginfo.h(74): warning C4047: 'initializing': 'const _zend_internal_arg_info *' differs in levels of indirection from 'uint32_t'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\cl.exe"' : return code '0x2'
Stop.
I had to regenerate the arginfo header files.
I added two new functions and don't know why I get a segfault when invoking scard_begin_transaction()...
I am not that deep into PECL extension debugging so I can not figure out what is going wrong.
When running ./docs/examples/simple.php I get a segmentation fault when executing the script on line 647 in pcsc.c:
ZEND_FETCH_RESOURCE(hCard, SCARDHANDLE, &conn_res, -1, PHP_PCSC_CONN_RES_NAME, le_pcsc_conn_res);
GDB gives me this:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4b1c611 in zif_scard_begin_transaction (execute_data=0x7ffff52136d0, return_value=0x7ffff5213370)
at /home/hanez/code/pcsc-for-php/pcsc/pcsc.c:647
647 ZEND_FETCH_RESOURCE(hCard, SCARDHANDLE, &conn_res, -1, PHP_PCSC_CONN_RES_NAME, le_pcsc_conn_res);
I believe I did everything right but it seems I didn't... :(
Can someone explain what is wrong or give me some hints how to debug this?
Hi
Thanks for project
How to send apdu for getUid ?
Please help me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.