PHP 5.3.2 x64 (64 Bit) Windows Binary

Some of you requested that I compile 64 bit Windows binaries for PHP 5.3.2 since they are not officially available from the PHP website. And so, I did and you will find the download link at the end of this post. But first let me tell you about a bug in this release that may or may not affect you. ๐Ÿ˜€

I compiled PHP 5.3.1 a few weeks ago but noticed that scripts that used the mysql extensions were not working. I thought this was because of a problem with the mysql extensions in this particular build, since the scripts were working fine with a 64 bit build of PHP 5.3.0 that I downloaded from http://windows.php.net/qa/.

Yesterday, after I compiled PHP 5.3.2, I noticed the same problem. And after a lot of messing around I realized that the problem was because PHP was not resolving “localhost” to “127.0.0.1” and instead resolving to the IPv6 address “::1”.ย  As mentioned before, this problem is not there in PHP 5.3.0, so I believe its a bug in PHP.

A good workaround for this problem is to comment out “::1ย ย ย ย ย ย ย ย ย ย ย ย  localhost” in your “hosts” file (C:\Windows\System32\drivers\etc\hosts) if it isn’t already, and uncomment “127.0.0.1ย ย ย ย ย ย  localhost” if it is commented out by default, as is the case with Windows 7. Another workaround is to use “127.0.0.1” in your PHP scripts instead of “localhost”.

Also, I tried compiling the mysql extensions with libmysql instead of mysqlnd to see if the problem persisted. I was able to compile the php_mysql extension successfully with libmysql (the php_mysqli and php_pdo_mysql extensions failed to compile with libmysql), and noticed that the problem wasn’t there. Scripts that used the php_mysql extension to connect to the mysql database with “localhost” defined as the database host, were working fine. So, I have included the php_mysql extension compiled with libmysql with this release.

So far, this “localhost” resolution bug is the only one that I have come across in this release.

Anyway, this release also includes the php5apache2_2.dll module for use with 64 bit versions of Apache 2.2.

And here is the configure log for anyone interested in it.

Download

php-5.3.2-Win32-VC9-x64.zip

CRC32: A356949C

MD5: F16FF84C27CBB642B4ED1E25FE997F82

SHA1: DCCF68C0935ECE581D1F0208F6E8A27C265CBF03

Related Posts:

You can follow any comments to this entry through the RSS feed. You can leave a comment, or trackback from your own site.

36 Comments

  • A big thankyou for compiling and making available for download the latest version of PHP x64 VC9 edition for Windows.

    One issue I see is that the file libmysql.dll will need to be copied to a folder thats included in the “PATH” variable like \windows or \windows\system32 or the mysql extension will not load.

    Are you able to supply the php_mysql.dll extension file that was compiled against mysqlnt as a seperate download here.

    Thanks again.

  • Thank’s a lot for providing this version of PHP. A question: Do you have or can you point me to the related DLL-files for php_mssql?

    Regards

  • is it possible to get a NTS version compiled? I am setting up our new win 2008R2 server for Joomla to be installed (production company web server) & I don’t have much experience with IIS, from what i have read the NTS version of php is more responsive (in fastCGI mode). I am a bit confused as to the best way to setup php in Win 2008R2 server as it is 64bit, can you recommend the best way to go about getting php up & running so that it is fast & reliable?

  • Sure I can compile the NTS version. But it really shouldn’t be used for production. I recommend that you use the official 32 bit PHP binaries for production. You can run it in fastcgi mode or use the php5isapi.dll. Here is a tutorial on how to use the 32 bit php5isapi.dll with 64 bit IIS.

  • I owe you a big case of your favorite beer/other preferred beverage. Spent hours trying to find why php would refuse to access the mysql database. Making sure localhost was mapped to 127.0.0.1 in hosts and the ipv6 reference was NOT mapped made it work. Thanks!

  • @Jonas

    I don’t use memcache so I didn’t compile memcache.dll. But if the version from that site is working fine, I don’t see any reason to compile it again myself.

    @Hansi

    I am glad you found my post helpful. ๐Ÿ˜€

  • Huuuh! Great deal! Thank you very much…
    I finally understand why my Wamp server does not work properly on my brand new windows 7 64 bits… I chased around for notice of incompatibility, but found nothing.
    Your explanation on localhost stuff was a revelation for me!. I effectively have this Host mentionned everywhere in my PHP code.
    I try a little ping localhost on a command line window, and eventually the bug comes from Microsoft Windows. I guess that mysqlnd driver relies on OS answer on gethostbyid question…
    Anyway, your workaround works fine for me
    Again all my thanks

  • Hi Anindya,

    Yet another thank you for a job well done. But …. (there always has to be one doesn’t there!) is there any chance of compiling a version of php_apc? I can find various x86 versions on the ‘net but absolutly nothing for a 64 bit version.

    Once again, thanks for all your effforts

  • Man, thanks a lot for that – I’ve been struggling for hours and already suspected myself to be a bit stupid. I’ve built many apache / php / mysql installations before, but had never thought of the hosts file. You saved my day. Thanks!

  • Thanks a lot for compiling and publishing this package and for all the tips, posted here.
    It is very helpful and useful ๐Ÿ™‚

  • Thank you very much, I need to nts is because my server is iis7.5 x64 + fastcgi + wincache + mysqlx64 + php 5.2.13 x86 why I have an urgent need, if you have time, hope you can build what x64 5.2.13 nts my site phpinfo http://www.kupai.me/1.php

  • please compile PHP 5.2.13 non thread safe x64 version and wincache x64 version. Please, urgently needed

  • @Anindya

    Fantastic work, thank you very very much

    @Alberto

    Those instructions in your zip file were excellent, thanks.

  • Thanks a lot for your work.

    Windows 2K8 R2 is only x64 and we need to have WAMP in Full x64.
    It is incomprehensible that there are no official compilations.

    • What a coincidence. I was preparing to post PHP 5.3.3 binaries when I saw your comment. ๐Ÿ˜€

      Anyway, the new PHP 5.3.3 binaries which I have now posted here include the php5isapi.dll. Last time (PHP 5.3.2) it failed to compile, so I disabled it. This time I made some modifications to the source code to get it to compile successfully. I have tested it myself and it seems to be working fine. ๐Ÿ™‚

  • Hello sorry, I looking for php_bcompiler.dll and php_ffi.dll php 5.3 nts x86
    but on Internet is nothing, if you should help me thanks, I’ll wait you answer.

Leave a Reply to Trevor