cobisja / tad-php

PHP Library for ZK Time & Attendance Devices
MIT License
213 stars 159 forks source link

Help... please #27

Open aries288 opened 7 years ago

aries288 commented 7 years ago

I get this error when running the library The code I'm using is

use TADPHP\TADFactory; use TADPHP\TAD;

$tad = (new TADFactory(['ip'=>'192.168.37.201', 'com_key'=>0]))->get_instance();

And send me this mistake Fatal error: Call to undefined function TADPHP\Providers\socket_create() in C:\xampp\htdocs\marcador\lib\Providers\TADZKLib.php on line 258

cobisja commented 7 years ago

HI,

Is php-curl installed?

Does the device have an integrated web server?

Does the device have a firmware ZEM 800, 600 or 5xx?

Best regards,

Cobis

El 30/06/2017 11:14, "aries288" notifications@github.com escribió:

I get this error when running the library The code I'm using is

use TADPHP\TADFactory; use TADPHP\TAD;

$tad = (new TADFactory(['ip'=>'192.168.37.201', 'com_key'=>0]))->get_instance();

And send me this mistake Fatal error: Call to undefined function TADPHP\Providers\socket_create() in C:\xampp\htdocs\marcador\lib\Providers\TADZKLib.php on line 258

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cobisja/tad-php/issues/27, or mute the thread https://github.com/notifications/unsubscribe-auth/AJzLMqTawnArFDON5hTfl5NcZt8xGKqAks5sJRDCgaJpZM4OKtii .

aries288 commented 7 years ago

php-curl installed yes installed

the device have an integrated web server

How can I tell if my device has a built-in web server?

the firmware is 4.0.1 build 74 the device is zkteco K14

Excuse me, do you speak Spanish?

aries288 commented 7 years ago

OK thanks At the end solutions the error but now throw me this Fatal error: Uncaught exception 'TADPHP \ Exceptions \ ConnectionError' with message 'Unable to start connection with device 192.168.37.201' in C: \ xampp \ htdocs \ bookmark \ lib \ TAD.php: 408 Stack trace: # 0 C: \ xampp TADPHP \ TAD-> check_for_connection () # 1 C: \ xampp \ htdocs \ marker \ index.php (37): TADPHP \ TAD -> __ call ('poweroff' , Array) # 2 C: \ xampp \ htdocs \ bookmark \ index.php (37): TADPHP \ TAD-> poweroff () # 3 {main} thrown in C: \ xampp \ htdocs \ bookmark \ lib \ TAD.php Online 408 What do you think the current error is?

cobisja commented 7 years ago

Hi,

It seems the library cannot connect with your device. Due you already told me you have installed php-curl (and of course you have verified your device's network parameter, haven't you?), I suposse your device is unable for responding because it does not have an integrated web server. Keep in mind, TAD-PHP checks if the device is able for commands processing and for achieving that, it sends a "are you alive" package, using curl, targeted to the integrated web server.

Again, my advice is: double check your device to ensure it has an integrated web server. Take a look to the technical sheet of the device, or google it.

Remember, if the device does not have an integrated server, TAD-PHP won't work.

Also it is hard for me providing help to you related with XAMPP configuration, because I'm a Linux guy. My develop environment is under Ubuntu Linux

Best regards,

Cobis

2017-06-30 13:48 GMT-04:00 aries288 notifications@github.com:

OK thanks At the end solutions the error but now throw me this Fatal error: Uncaught exception 'TADPHP \ Exceptions \ ConnectionError' with message 'Unable to start connection with device 192.168.37.201' in C: \ xampp \ htdocs \ bookmark \ lib \ TAD.php: 408 Stack trace: # 0 C: \ xampp TADPHP \ TAD-> check_for_connection () # 1 C: \ xampp \ htdocs \ marker \ index.php (37): TADPHP \ TAD -> __ call ('poweroff' , Array) # 2 C: \ xampp \ htdocs \ bookmark \ index.php (37): TADPHP \ TAD-> poweroff ()

3 {main} thrown in C: \ xampp \ htdocs \ bookmark \ lib \ TAD.php Online

408 What do you think the current error is?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cobisja/tad-php/issues/27#issuecomment-312331454, or mute the thread https://github.com/notifications/unsubscribe-auth/AJzLMl9c2UR9_RByODrOgzcdzg993kddks5sJTT-gaJpZM4OKtii .