Page 1 of 1

fsockopen() problems, please help

Posted: Thu Feb 19, 2004 12:49 pm
by triceron
Hi, I wanted to connect to some usenet servers. So I did this:



$ns = fsockopen("news-read2.maxwell.syr.edu", 119, $errno, $errstr);
fputs($ns,"list \r\n");
...
fclose($ns);




but I keep getting this>

Warning: fsockopen(): unable to connect to news-read2.maxwell.syr.edu:119 in /usenet.php on line 93
Warning: fputs(): supplied argument is not a valid stream resource in /usenet.php on line 106
Warning: fclose(): supplied argument is not a valid stream resource in /usenet.php on line 143


the unable to connect is weird, I am trying to connect to a working usenet news server. The one that is used in this script can be easily used in a newsreader software [like outlook express] without errors (download list of newsgroups for example)

what's wrong?

Posted: Thu Feb 19, 2004 5:49 pm
by niceguyeddie
$ns = fsockopen("news://news-read2.maxwell.syr.edu", 119, $errno, $errstr);

work?

Posted: Thu Feb 19, 2004 8:38 pm
by triceron
niceguyeddie wrote:$ns = fsockopen("news://news-read2.maxwell.syr.edu", 119, $errno, $errstr);

work?
unfortunatelly not.. just one more error

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: host/servname not known in /data/www/triceron/test/examples/news.php.net/usenet.php on line 93

(I tried the ip as well..)