Re: fsockopen to own server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 16 Dec 2004 10:02:02 -0800, Richard Lynch wrote:

> Doc wrote:
>> I'm having a problem with fsockopen and was wondering has anyone ever
>> noticed a case where it will work from machine1 (dev machine) to machine2.
>> But when the was placed onto machine2 it wouldn't work connecting to it's
>> own ip address;
>>
>> when connecting via telnet it returns:
>>
>>  Escape character is '^]'.
>> * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN]
>> serverip IMAP4rev1 2003.339-cpanel at Wed, 15 Dec 2004
>> 19:33:27 +0000 (GMT)
> 
> You *ARE* getting this when telnetting from/to the same machine, right?...

Yes. the same machine.

>> so I don't think it's the firewall. the error it returns is "No such file
>> or directory". So it seems that when it connects (which it does without
>> failing), the file seems to be deleted, as the file the variable refers to
>> doesn't exist on the fs either.
>>
>> if(($s = fsockopen($id["sockname"], 0, $errno, $errstr)) === FALSE)
>>
>> $id["sockname"] is in the format /tmp/filename with the filename changing
>> based on a random value and there are no files with that format in /tmp
> 
> Despite the user contributed note on
> http://php.net/manual/en/transports.unix.php
> I'm wondering if you shouldn't use the unix:// bit -- and try udg:// as
> well, if that doesn't work.

Tried both without any success.

> Finally, if there are no files with that format in /tmp, how will this
> work?  Or is that how unix socket streams are supposed to work?  I'm
> ignorant in this area...  But it seems to me that if you try to open a
> file that's not there, you SHOULD get FALSE back. :-)

I'm as ignorant as you :) this is an ex-coworkers code. From
what I can tell from the file should be there from when it connects
initially (as that's the way it is when it's on the dev machine) but
they're not although there is no failure to connect, which suggests to me
that the file is deleted.

>> it always returns false for some reason on this server.
> 
> And what, if anything, are in $errno and $errstr?
> 
> You've put them in there, you might as well use them :-)

$errno 2
$errstr "No such file or directory"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux