Still problems

Marckus_e

Verified User
Joined
Feb 18, 2004
Messages
36
Location
Sweden
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

I have now tried both IP and Name, no difference.

I can access it manually by entering the adress so the server is answering, i have tried the script from different machines also and same error!

Best Regards
Marcus Eklund
 
I am using the phpclass from l0rdphi.
and the i am using the example that should show all the users.

I will check again tomorrow but i have been trippelchecking all the info.

Best Regards
Marcus Eklund
 
Odd. Can you paste the code you're using (minus password), along with the content of /etc/hosts (long shot) :)
 
Hi!

I just checked my hosts on my machine
just 127.0.0.1 localhost

The code is the same as in
example.show_all_users.php

Except for the right login/password and adress to server

Best Regards
Marcus
 
PHP:
<?php

include 'httpsocket.php';

$sock = new HTTPSocket;

$sock->connect('https://ipnumber',2222);
$sock->set_login('login','password');

$sock->query('/CMD_API_SHOW_ALL_USERS');
$result = $sock->fetch_parsed_body();

print_r($result);
print_r($sock->error);
?>

That is the code in example.show_all_users.php

and httpsocket.php is default.

except for
PHP:
$fp = fsockopen( $this->remote_host, $this->remote_port, $sock_errno, $sock_errstr, 30 );

Line : 88

Best regards
Marcus
 
Yeah, you can't connect to https streams unless you compile PHP with OpenSSL.
 
Even with SSL he can't use it. That parameter is passed directly to fsockopen(). fsockopen() doesn't parse urls - its usual socket connect function that uses ip/hostname to connect. So there should be no protocol at all - just ip or hostname. If you want to use SSL then use CURL instead of sockets.
 
No, I'm pretty sure SSL will work with fsockopen. You must use ssl:// inplace of https:// though. Port 443, too.
 
I didn't know about that. Looks like that feature was added in php 4.3.0. Thanks for info.
 
I have tried with both SSL:// and nothing but the adress..

Doesn't work either way :/

/Marcus
 
phpinfo()

is --with-openssl in your configure line?

Also do you have OpenSSL in your SERVER_SOFTWARE section
 
Looking at the error again, it appears the name your connecting to doesnt resolve...

Check that what your trying to connect to resolves ok (try a local and external ping / traceroute)

Chris
 
It resolves if i ping/traceroute.. i have tried from two different locations and the script doesn't work.. but it works fine if i go there manually..

/Marcus
 
Back
Top