Closed joho1968 closed 2 years ago
Is port 43 open? Try checking a plain whois from the shell of the same machine. it's working?
Maybe a traceroute to whois server can help too.
Yes, regular WHOIS works, regardless of using a domain name or an IP address. Also regardless of TLD.
Is there a place in the code I can add debug output to, in an attempt to catch this?
Look on SocketLoader class where the socket connection is opened https://github.com/io-developer/php-whois/blob/5b84e30c0a02c8abdbfa49adaae28c7aefad54b1/src/Iodev/Whois/Loaders/SocketLoader.php#L9
OK, found it :-)
For security reasons fsockopen() is on the list of disabled functions. It works if I remove it from the list.
The code should (IMHO) check for this somewhere, and possibly throw an exception to the effect of "Required functions have been disabled in PHP configuration".
Disabled where? fsockopen is a good old function available from early years of PHP, never found it on my standard installation (servers or docker images). https://www.php.net/manual/en/function.fsockopen.php
I think check for it is outside the scope of this library. Connection error is enough The connection error is enough, it explains that something above (from the server to the network) is preventing communication and the error must be looked for elsewhere.
Disabled by putting it in the configuration directive "disable_functions". In our environment, we lock down PHP as much as possible. It's better to be strict and open when required, and in many "standard web hosting environments", it's not needed :-)
You're probably right about the scope. It was just an idea to maybe save others from scratching their heads :-)
Thanks for your time on this issue though. Much appreciated.
PHP-Whois version: 4.1.4
PHP version: 7.4.3
Description
I keep getting a "Disconnect or connection timeout" exception, regardless of the domain I use (.se .com .nu etc). There's nothing blocking outgoing traffic.
I'm just using a simple piece of testing code like so:
Is there a specific module or .php file in which I can start looking for the problem, given the type of the exception?