EvilFreelancer / routeros-api-php

Mikrotik RouterOS API PHP client for your applications
https://mikrotik.com/software
MIT License
396 stars 146 forks source link

Error Stream timed out #85

Closed fikurimax closed 2 years ago

fikurimax commented 2 years ago

I tried to read user profiles but keep getting this error

Stream timed out {"exception":"[object] (RouterOS\\Exceptions\\StreamException(code: 0): Stream timed out at C:\\laragon\\www\\projectname\\vendor\\evilfreelancer\routeros-api-php\\src\\Streams\\ResourceStream.php:55)

but somehow when I create a user it just works fine

code I used:

try {
        $client = new Client(new Config([
            'host'  => $address,
            'user'  => $user,
            'pass'  => $pass,
            'port'  => (int) $port
        ]));
    } catch (\Throwable $th) {
        throw $th;
    }

$profiles = $client->query(new Query('/ip/hotspot/user/profile/print'))->read();
fikurimax commented 2 years ago

I just tested by creating a new user profile and it succeed, only print command doesn't work

EvilFreelancer commented 2 years ago

Hi! Which version of RouterOS do you have?

Did you tried to increase a socket timeout option?

https://github.com/EvilFreelancer/routeros-api-php#list-of-available-configuration-parameters

fikurimax commented 2 years ago

I just solved it. apparently, the port collides with other services. Thanks for responding