Problems with getprotobyname, win, php 4.3.10
| From: | php_74562 at mail dot bg | Date: | Mon, 24 Jan 2005 17:57:55 +0000 |
| Subject: | Problems with getprotobyname, win, php 4.3.10 | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-25445@lists.php.net to get a copy of this message | ||
Hi list,
I am writing a standalone PHP program (not web based, but
not GTK either, just a console app) and I want to
re-distribute the PHP binaries with it. Then I noticed that
on a particular WinXP machine - not a brand new install,
but recent-ish - the getprotobyname('tcp') call fails
(returning bool(false) according to var_dump).
When trying to reproduce the problem on my other WinXP
(where it normally works fine) I have pinpointed it to the
file called
C:\WINDOWS\system32\drivers\etc\protocol
If I either unset the SystemRoot environment setting, or
rename the 'protocol' file I get the same behaviour of
getprotobyname() (returning false instead of 6)
Btw, the SOL_TCP constant is undefined when getprotobyname
returns false, as it is set at runtime.
Of course I can bypass this by more ot less 'safely'
hardcoding SOL_TCP to be 6 (if undefined), but I don't like
it - I'd rather discover the primary reason for this to
happen.
Has anyone here tackled with a similar problem? Ideas what
might be wrong, or what additional test could be done?
Thanks.
-----------[ Code to reproduce ]-------------
<?php
$a = getprotobyname('TCP');
var_dump($a);
?>
---------------------------------------------
-----------------------------
http://www.atol.bg - Íàìåðè áèâøèòå ñè
ñúó÷åíèöè è ñòàðè ïðèÿòåëè!