From: motion_4u at hotmail dot com
Operating system: Apache 2 on win2k
PHP version: 5.0.3
PHP Bug Type: Sockets related
Bug description: socket_bind can't bind
Description:
------------
socket_bind() function on Apache2/ Win2k can't bind
Reproduce code:
---------------
$dest="127.0.0.1";
$port=80;
//"daemon" in UDP
$socketD = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if($socketD === FALSE) { // something went wrong
echo 'socket_create failed:
'.socket_strerror(socket_last_error())."\n";
exit(1);
}
/*
This is the second option but still doesn't work
if(!socket_bind($socketD, "0.0.0.0", 27123))
*/
if(!socket_bind ($socketD, 0, $port))
{
socket_close($socketD);
echo 'socket_bind failed: '.socket_strerror(socket_last_error())."\n";
exit(1);
}
Expected result:
----------------
This is the PHP error message:
Warning: socket_bind() [function.socket-bind]: unable to bind address
[0];
I realy dug into the documentations and examples and find it hard to
believe that I do something wrong. The warning message explains that the
socket it already binded and cannot be used twice :((
--
Edit bug report at http://bugs.php.net/?id=32363&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32363&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32363&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32363&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32363&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32363&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32363&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32363&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32363&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32363&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32363&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32363&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32363&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32363&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32363&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32363&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32363&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32363&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32363&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32363&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32363&r=mysqlcfg