ZKLibrary icon indicating copy to clipboard operation
ZKLibrary copied to clipboard

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

Open seemagebandnut opened this issue 5 years ago • 1 comments

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
<body>
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); ?>
    <table border="1" cellpadding="5" cellspacing="2">
        <tr>
            <th colspan="6">Data Attendance</th>
        </tr>
        <tr>
            <th>Index</th>
            <th>UID</th>
            <th>ID</th>
            <th>Status</th>
            <th>Date</th>
            <th>Time</th>
        </tr>
        <?php
        $attendance = $zk->getAttendance();
        sleep(1);
        while(list($idx, $attendancedata) = each($attendance)):
            if ( $attendancedata[2] == 14 )
                $status = 'Check Out';
            else
                $status = 'Check In';
        ?>
        <tr>
            <td><?php echo $idx ?></td>
            <td><?php echo $attendancedata[0] ?></td>
            <td><?php echo $attendancedata[1] ?></td>
            <td><?php echo $status ?></td>
            <td><?php echo date( "d-m-Y", strtotime( $attendancedata[3] ) ) ?></td>
            <td><?php echo date( "H:i:s", strtotime( $attendancedata[3] ) ) ?></td>
        </tr>
        <?php
        endwhile
        ?>
    </table>
    

<?php

    sleep(1);
    $zk->disconnect();
endif

?>

seemagebandnut avatar Jan 02 '20 10:01 seemagebandnut

Hi Sir,

What device did you used?

ameik297 avatar Apr 30 '21 01:04 ameik297