php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48761 php crashes on start - getaddrinfo could not be located
Submitted: 2009-07-01 22:19 UTC Modified: 2012-10-23 09:31 UTC
Votes:52
Avg. Score:4.6 ± 1.0
Reproduced:43 of 45 (95.6%)
Same Version:31 (72.1%)
Same OS:41 (95.3%)
From: aheckmann at m-s dot de Assigned:
Status: Wont fix Package: Reproducible crash
PHP Version: 5.3.0 OS: win32 only - Windows 2000 SP4
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-07-01 22:19 UTC] aheckmann at m-s dot de
Description:
------------
Tested with VC6 and VC9 (+vcredist_x86.exe) Version of PHP 5.3.0

PHP does not start an produces the following error message:

php.exe - Entry Point Not Found : 
The procedure entry point getaddrinfo could not be located in the dynamic link library WS2_32.dll


Reproduce code:
---------------
php.exe -v

Expected result:
----------------
php shows version info

Actual result:
--------------
Php does not start an shows the following error:

php.exe - Entry Point Not Found : 
The procedure entry point getaddrinfo could not be located in the dynamic link library WS2_32.dll

Patches

win2k-winsock2-fix (last revision 2012-06-04 14:18 UTC) by ricardo12458 at hotmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-01 22:23 UTC] aheckmann at m-s dot de
In my opinion this 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:
http://msdn.microsoft.com/en-us/library/ms738520%28VS.85%29.aspx

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.

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

The windows release notes for 5.3 only mentioned that pre-windows 2000 support is dropped.

Thanks
 [2009-07-02 10:18 UTC] johannes@php.net
Win 2000 is the required minimum version, or should be, while I don't know about required service packs and other patches. Pierre?
 [2009-07-02 17:08 UTC] jon dot harrell at gmail dot com
If PHP support for w2k remains then use of GetAddrInfoW must be woked around. The article above explains very plainly that this function is XP SP2+ ONLY. Currently PHP 5.3 is not compatible with w2k-XP SP1.


"The GetAddrInfoW function is the Unicode version of getaddrinfo. The GetAddrInfoW function was added to the Ws2_32.dll in Windows XP with Service Pack 2 (SP2). The GetAddrInfoW function cannot be used on versions of Windows earlier than Windows XP with SP2."
 [2009-07-02 23:48 UTC] kalle@php.net
The problem with fixing this (by doing an include to emulate the functions on systems without it (Windows 2000, XP prior SP2) is that it will slow down for other system that already got it, as it will attempt to load the ws2_32 library and search for the symbol locations, which is just slowing us down for no *real* reason.

The question whether to fix this is trival, Me, Pierre and the others will discuss this and how to deal with it.
 [2009-07-17 12:04 UTC] jet5y at hotmail dot co dot uk
However, considering that most servers running it would either be 2000 or 2003 and not XP then a workaround would seem more sensible at the slight detriment for now of XP SP2 systems.
 [2009-07-29 23:00 UTC] jon dot harrell at gmail dot com
Until this bug is fixed wouldn't it make sense to place a notice warning all potential users that the binary downloads at http://windows.php.net/download/ require XP SP2 or above?
 [2009-08-10 11:45 UTC] pajoye@php.net
Only 2000 and xp with SP1 (or no SP) are affected. 2003 does work as expected.

By the way, I very much doubt that most servers use 2000.

Set as "to be documented".
 [2009-08-14 23:40 UTC] bruce at thinkcorporate dot com
I run IIS 6 on W2K SP4 and get the same error.

I reviewed

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

How do I implement the fix?
 [2009-08-24 20:26 UTC] bruce at thinkcorporate dot com
Specifically where do I obtain and include the mentioned Ws2tcpip.h and Wspiapi.h files as the "fix" to getaddrinfo on older versions of Windows?

Does the PHP.exe need to be recompiled with the mentioned includes?
 [2009-09-03 23:09 UTC] composer at singers dot org dot nz
I run Small Business Server 2000 and need to set up PHP within IIS to support some services that I need to provide and right now am unable to do so so am "hog tied".    
Although only a small site being able to provide the services required for the organization is critical.. Win2K SBS has proved very stable and reliable and the owners do not wish to change.. The old adage here.. "If it ain't broke don't fix it and don't screw with it" is what they like.  The current environment meets their needs perfectly and has been highly reliable.   Now they wanna add an extra service that uses MYSQL and PHP.  So installing PHP is critical. Therefore some fix for them is important or at least a practical workaround.
So yep there are Win2K servers out there and YEP a "fix" of some sort would be good.

Thanks
 [2009-09-03 23:43 UTC] pajoye@php.net
PHP 5.2 works just fine in this configuration. So you can follow they lovely adage and keep using 5.2.x with the existing apps :)
 [2009-09-19 07:25 UTC] broth at superp dot com
I sure wish a notice was put on PHP 5.3.0 that is would not work with win2000 I had PHP working!  After the load of V5.3.0 my previous V 5.1 version is corrupt!  One simple Warning note would have saved me hours!

Thanks for the concern.
 [2009-12-16 22:39 UTC] joe dot at dot trends at gmail dot com
So is the only solution to return to PHP 5.2.11? 

I would really like to see this fixed.
 [2009-12-16 23:08 UTC] pajoye@php.net
No, the solution is to use at least a 10 years old operating system. The idea solution is to use a recent one.
 [2010-01-02 00:26 UTC] rob-sturgill at yahoo dot com
"No, the solution is to use at least a 10 years old operating system. The idea solution is to use a recent one."

Pierre,

While I appreciate what your team does more than I can possibly express, I believe this is a shocking response. If 5.3.0 doesn't support Windows 2000, then simply drop support for Windows 2000 in the documentation. Fine, no problem. Like the prior comment from 'broth' it's agonizing to break a working installation, going to 5.3, when that version simply does not support the OS. Otherwise, users like myself are going to waste hours debugging this mess. 

I respectfully request a change to the 'Changes made to Windows Support' to correct the statement: "The minimum Windows version is now Windows 2000; Windows 98, ME, and NT4 are no longer supported."
 [2010-02-26 15:24 UTC] hofmann at jonhofmann dot com
I'd like to see PHP 5.3 work for w2k as I probably won't be able to afford to get a better OS soon and have too much invested in what works now ... If I would have just had the simple warning about 5.3 not working on w2k I wouldn't have lost HOURS recently.

RE: Bruces question
"where do I obtain and include the mentioned Ws2tcpip.h and
Wspiapi.h files"

I found one, wspiapi.h, in the IPv6Kit supplied on a windows site.
 [2010-02-26 15:51 UTC] pajoye@php.net
It won't happen. Stay with 5.2 if you need windows 2k support.
 [2010-11-16 00:26 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
 [2010-11-16 00:32 UTC] pajoye@php.net
"since you officially still provide support for windows 2000 in php 5.3"

No, we don't.
 [2012-10-23 09:31 UTC] cataphract@php.net
-Status: Open +Status: Wont fix
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 13:02:15 2014 UTC