php nntp connection timeout

Discussion in 'PHP' started by _vlada_, Apr 12, 2006.

  1. #1
    I dont have any luck, also little or no knowledge in php, in making connection with nntp server. I allways get connection time out. Tried dozen of scripts, allways getting empty pages with no error. Now I see that scripts even cant connecto to server. I tried on several sites, all on different hosts.

    here example of smallest part of code i found, and nothing.
    allways get error_log filled with connection time out: like this: [12-Apr-2006 13:35:59] PHP Warning: imap_open(): Couldn't open stream {freenews.netfront.net:119/nntp/novalidate-cert}alt.test in /home/

    <?php
    $user = "";
    $pass = "";
    
    // note the use of the port number and /nntp
    // instead of a mailbox, use a usetnet group name
    $imap = imap_open("{freenews.netfront.net:119/nntp/novalidate-cert}alt.test", $user, $pass);
    if (!$imap) {
       print_r(imap_errors());
    }
    ?>
    Code (markup):

    does anyone have idea how to solve this? do I need some extra code like /novalidate-cert [i tried that one, still nothing]?:confused:
     
    _vlada_, Apr 12, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    http://www.phpclasses.org/nntp
    http://www.phpclasses.org/browse/package/157.html

    Not sure if you came across those in your searches.

    But this should work.

    $imap = imap_open("{freenews.netfront.net:119/nntp}alt.test", $newsuser, $newspass);
    Code (markup):
    Or this one should set $imap to the connection ID.

    $imap = imap_open("{freenews.netfront.net:119/nntp}", $newsuser, $newspass, OP_HALFOPEN);
    Code (markup):
     
    Slapyo, Apr 12, 2006 IP