kamshory / ZKLibrary

ZKLibrary is PHP library for reading and writing data to attendance device using UDP protocol. This library useful to comunicate between web server and attendance device directly without addition program. This library is implemented in the form of class. So that you can create an object and use it functions.
GNU General Public License v2.0
193 stars 176 forks source link

Socket connection failed on server and it's working on localhost #83

Open seemagebandnut opened 4 years ago

seemagebandnut commented 4 years ago

Socket connection failed on server but it's working on localhost. please let me know what php configuration is required.you can see here phpinfo. Socket extension is enable and no disable function. it shows error couldn't create socket: [11] Resource temporarily unavailable. Test url-http://3.133.73.57/socket/dnaextrim-php_zklib-8b46116/zktest.php

Please help me to fix this issue. Below is code.

ZK Test connect(); if ($ret === false) { $errorcode = socket_last_error(); $errormsg = socket_strerror($errorcode); die("Couldn't create socket: [$errorcode] $errormsg"); } sleep(1); if ( $ret ): $zk->disableDevice(); sleep(1); ?> getAttendance(); sleep(1); while(list($idx, $attendancedata) = each($attendance)): if ( $attendancedata[2] == 14 ) $status = 'Check Out'; else $status = 'Check In'; ?>
Data Attendance
Index UID ID Status Date Time
disconnect(); endif ?>
ameik297 commented 3 years ago

Hi Sir,

What device did you used?