php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47963 PHP does not load - getaddrinfo doesn't exist
Submitted: 2009-04-13 21:37 UTC Modified: 2009-10-27 20:07 UTC
Votes:33
Avg. Score:4.7 ± 0.7
Reproduced:32 of 33 (97.0%)
Same Version:19 (59.4%)
Same OS:29 (90.6%)
From: cranderson at att dot net Assigned:
Status: Wont fix Package: *Configuration Issues
PHP Version: 5.3.0RC1 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
24 + 35 = ?
Subscribe to this entry?

 
 [2009-04-13 21:37 UTC] cranderson at att dot net
Description:
------------
Windows Binary:
php-5.3-win32-VC9-x86-latest.zip
(Win2000 Pro/Win2000 Server - VC9 libraries installed)

Windows error message:

"The procedure entry point getaddrinfo could not be located in the dynamic link library ws2_32.dll."

Microsoft Link:
http://msdn.microsoft.com/en-us/library/ms738520(VS.85).aspx

In brief:
The getaddrinfo function was added to the Ws2_32.dll on Windows XP and later. To execute an application that uses this function on earlier versions of Windows, then you need to include the Ws2tcpip.h and Wspiapi.h files.

getaddrinfo support on versions of Windows earlier than Windows XP is limited to handling IPv4 name resolution.

The GetAddrInfoW function cannot be used on versions of Windows earlier than Windows XP with SP2.

Thanks,
Carl

Reproduce code:
---------------
// cli sapi
php -v

Expected result:
----------------
PHP version.


Actual result:
--------------
Windows error message:
"The procedure entry point getaddrinfo could not be located in the dynamic link library ws2_32.dll."

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-13 21:43 UTC] pajoye@php.net
Does it work on XP or do you see this error only on windows 2000? If yes, which service pack do you use?
 [2009-04-14 09:48 UTC] mattwil@php.net
Yeah, I'm pretty sure this is the error I was getting in 2000 that I mentioned in Bug #47938. (Wondered whether the VC9 releases are supposed to work on 2000, though the VC9 notes don't say otherwise.)

SP4 (+ Update Rollup 1) for me if you're asking about 2000's service pack.
 [2009-04-14 09:55 UTC] pajoye@php.net
I do not have a windows 2000 to test (fetching one now). Can you confirm that it works with XP but not with 2000 (if you can :) please?
 [2009-04-14 10:12 UTC] mattwil@php.net
Yes, confirmed. I knew it worked with XP SP3, and since I can't get to that 2000 system now, I just installed the 2008 runtime on an old 2000 laptop (same service pack and all) and tried the latest 5.3 snap. The OP's error is the one I'm seeing.
 [2009-04-14 10:23 UTC] pajoye@php.net
Ok, I can't get a windows 2000 easily.

But reading again the error, it has nothing to do with the headers (we use them correctly or it will not even compile) but with the fact that your ws2 dll does not expose or contain getaddrinfo. Can you send verify it using depends.exe please?
 [2009-04-14 11:04 UTC] mattwil@php.net
I haven't used that tool before, so not exactly sure what I'm supposed to check, sorry. :-/ But anyway, selecting WS2_32.DLL under PHP.EXE > PHP5TS.DLL, the *addrinfo functions aren't in the bottom pane on 2000, and in the upper pane, freeaddrinfo/getaddrinfo are red instead of green on XP. Additionally, on 2000, the log area says "Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module."

Is that even close to anything you wanted to know...? A little lost in this area, but if you give me instructions, hopefully I can help. :-) (I'll be away for a bit now...)
 [2009-04-16 20:19 UTC] cranderson at att dot net
Hi,

Sorry about the delay getting back to this issue (taxes crap).  Anyway, the offending file in Win2000 Server/Pro and family is ws2_32.dll.  This file is part of service pack 4.  It is NOT related to VC6/9, etc.  (I have VC9 installed so that I can run the Apache distro from Apache Lounge.)

It does not have the getaddrinfo function.  This link:

http://msdn.microsoft.com/en-us/library/ms738520(VS.85).aspx

describes the problem in detail.  Unfortunately, anything less than XP service pack 2 will exhibit this behavior and will be unable to load PHP 5.3.  Microsoft is not going to update ws3_32.dll since it would involve tearing out winsock and supporting files.  The file is always in use by the OS, so I was unable to overwrite the DLL with a copy from 2003 server - maybe safe mode but I don't have the nerve.

Carl
 [2009-04-22 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-07-01 21:52 UTC] aheckmann at m-s dot de
I have the same problem/error on Windows 2000 using the VC6 and the VC9 builds of 5.3.0.
"The procedure entry point getaddrinfo could not be located in the dynamic link library WS2_32.dll."

In my opinion the above already mentioned document from microsoft describes the solution to fix the problem for older windows versions
that don't have the getaddrinfo function with an inline function:

Support for getaddrinfo on older versions of Windows

The getaddrinfo function was added to the Ws2_32.dll on Windows XP and later. 
To execute an application that uses this function on earlier versions of Windows, then you need to include the Ws2tcpip.h and Wspiapi.h files. 
When the Wspiapi.h include file is added, the getaddrinfo function is defined to the WspiapiGetAddrInfo inline function in the Wspiapi.h file. 
At runtime, the WspiapiGetAddrInfo function is implemented in such a way that if the Ws2_32.dll or the Wship6.dll 
(the file containing getaddrinfo in the IPv6 Technology Preview for Windows 2000) does not include getaddrinfo, 
then a version of getaddrinfo is implemented inline based on code in the Wspiapi.h header file. 
This inline code will be used on older Windows platforms that do not natively support the getaddrinfo function.

http://msdn.microsoft.com/en-us/library/ms738520%28VS.85%29.aspx

Will this be fixed, or is Win2k support dropped for php 5.3.x?

Thanks
 [2009-10-27 20:00 UTC] kenwilson at videotron dot ca
There's been no answer whether or not 5.3 will have support for Win2K - can someone please address this issue?
Thanks, Ken
 [2010-11-16 00:20 UTC] slgundam at gmail dot com
If you don't want to fix this, the system requirements for php need to be adjusted and since you officially still provide support for windows 2000 in php 5.3 and are not planning to fix this, support should be dropped aswell

Though i do find it weird that you provide support for a system but are not planning to fix a bug that in effect makes sure that the whole thing does not work at all on the OS in question
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 04:01:29 2024 UTC