Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.7

Bug #17473 undefined constant SOL_UDP
Submitted: 2010-06-08 00:18 UTC
From: hm2k Assigned:
Status: Open Package: Net_DNS (version 1.0.1)
PHP Version: 5.2.5 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2010-06-08 00:18 UTC] hm2k (James Wade)
Description: ------------ PHP Notice: Use of undefined constant SOL_UDP - assumed 'SOL_UDP' in /usr/lib/php/Net/DNS/Resolver.php on line 950 PHP Warning: socket_create() expects parameter 3 to be long, string given in /usr/lib/php/Net/DNS/Resolver.php on line 950 Test script: --------------- I'm not 100% sure how to reproduce at this moment in time.

Comments

 [2010-06-08 04:05 UTC] doconnor (Daniel O'Connor)
That's really odd - SOL_UDP is part of the PHP socket extension. http://theserverpages.com/php/manual/en/function.socket-create.php Can you check your php.ini to ensure you've got it properly enabled?
 [2010-06-10 01:59 UTC] hm2k (James Wade)
It must be enabled otherwise socket_create() wouldn't exist to return that kind of error. It doesn't occur all of the time and I'm unable to isolate a case at the moment. Perhaps it wouldn't harm to check if it's defined or not and then define it if not.
 [2010-08-08 16:44 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Feedback
Alrighty, what does the below render (to ask a stupid question)? <?php var_dump(extension_loaded("sockets")); echo SOL_UDP;
 [2010-08-09 12:25 UTC] hm2k (James Wade)
http://codepad.org/ZWctvLkd http://ideone.com/n8Bq6 However, on my system (5.3.2) it returns: bool(true) 17 While using Quercus I get: bool(false) 17 There is a definite inconsistency.
 [2010-08-09 12:26 UTC] bate (Marco Kaiser)
try to set error_reporting(E_ALL) and you will get a notice .. SOL_UDP isnt defined ...
 [2010-08-09 12:27 UTC] bate (Marco Kaiser)
i try to reproduce this
 [2010-08-09 12:28 UTC] bate (Marco Kaiser)
If i run var_dump(extension_loaded("sockets")); echo SOL_UDP; i get bool(true) and 17 as result ... which php version does you run? php -r "var_dump(extension_loaded("sockets")); echo SOL_UDP;"
 [2010-08-09 12:59 UTC] hm2k (James Wade)
-PHP Version: 5.3.2 +PHP Version: 5.2.5
Actually, my dev server is PHP 5.2.13 My test production server is PHP 5.2.8 I am unable to reproduce on these systems. However, I am able to reproduce on 5.2.5, which is what codepad uses: http://codepad.org/FrMynhoJ
 [2010-08-09 13:09 UTC] bate (Marco Kaiser)
 [2011-09-02 20:42 UTC] hm2k (James Wade)
>On UNIX systems php needs /etc/protocols for constants like SOL_UDP and SOL_TCP. >This file was missing on my embedded platform. If this is the solution then surely the code would need to accommodate this?
 [2011-09-02 20:42 UTC] hm2k (James Wade)
-Status: Feedback +Status: Open