Lucky for me MySQL 5.0 is available as a x64 version. But PHP and Apache is not available in x64 version so I have mentally prepared myself to compile PHP and Apache myself. Of course I only come here for help with Apache, I will seek help for PHP somewhere else.

I am using Microsoft Visual Studio 2005 which comes with a x64 compiler so that's no problem. But since the Apache Software Foundation is not supporting 64 bit technology on Windows (and does not actively support it on Linux as well) I'm in a bit of trouble. All services under Windows x64 (Windows XP x64 Edition or Windows Server 2003 x64 Edition) must be native x64 applications or they will not run.

Do you need to take special consideration regarding the source code when targetting x64? I would like to see a guide for compiling for x64, but meanwhile I will experiment some myself and see what I come up with.

Last edited by saivert on Fri 21 Apr '06 19:16; edited 2 times in total

1. Are you using Windows x64 yourself?
2. Does 2.2.1 source have more support for x64 than 2.2.0?

I know some parts of the Apache source code is prepared for 64 bit compatibility but I thought that only was for the Linux platform, but maybe that works for Windows x64 as well.
Thanks. I will try the 2.2.1 instead of 2.2.0 which was my original plan.

Update: I have downloaded the source for these components:

Apache 2.2.1

APR 1.2.7

APR iconv 1.1.1

APR util 1.2.7

PHP 5.1.2

openssl-WIN64 Snapshot (20060421)

zlib 1.2.3

I have installed ActiveState's ActivePerl for x64 and awk95 (renamed to awk.exe of course) so my build environment should be OK.

This project looks like will be fun. There are many things to learn while I progress.

Just to clear any doubts: I'm not going to compile a 32 bit version of Apache and run it on Windows x64. I will compile Apache using the x64 compiler from Microsoft which generates code that will not run on 32 bit, and requires a 64 bit capable CPU such as AMD64 and EM64T branded CPUs.

Well the apache binaries on here seem to work for me and I use Windows Server 2003 Enterprise x64 Edition.

Personally I am a dumb@ss when it comes to compiling, I don't really know where to start except for the apache source and Microsoft Visual C++ 2005 Express Edition (or a professional/enterprise edition if I can get one).

So anyone who can walk me through doing it please do, and feel free to treat me like I know jacksh!t because unless it involves ./configure, make and make install I have NO clue whatsoever!

Since I have never ever compiled Apache before, I must say that I finally got to compile Apache 2.2.0 for x86 using Visual Studio 2005. It runs okay with standard config.

Now I have to figure out how to swap the 32bit C compiler used in Visual Studio with the x64 compiler. I will have to install latest Platform SDK which includes the x64 compiler and somehow tell Visual Studio to use that compiler instead, or make a custom makefile.
I need help with this people.

I am having troubles installing your binaries. I keep getting the following error when I run httpd -k install :

Syntax error on line 68 of C:/Apache2x64/conf/http.conf : Cannot load C:/Apache2_x64/modules/mod_actons.so into server: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

I have reinstalled many times, but still no luck. All paths in the http.conf file have been set appropriately. Do you have any ideas what the problem may be??

Thanks Jorge for the binaries. I had compiled 2.2.0 myself in 64-bit mode but shortly after 2.2.2 came out. Your binaries saved me from redoing all the work. I did notice your binaries still represent themselves as Win32 (in ServerTokens and such). Inside include/os.h you can change this:

Code:

#define PLATFORM "Win32"

to something like:

Code:

#define PLATFORM "x64"

I myself have managed to compile PHP (5.1.2) in 64-bit. http://short-media.com/forum/showthread.php?t=45008 is a short thread about it. After I've been using it I've noticed some spots are still not perfect. File functions (such as file_get_contents) will timeout when not found instead of returning FALSE like they should. I also compiled it using very little modules, only the ones I needed. The hardest part for myself was finding all the 32-bit times "__time32_t" and changing it to "time_t" for 64-bit conversion. This included not only the PHP source but includes from Visual Studio itself.

I'll have a look into that (PHP),
well i don't know C but shouln't it be posible to detect the platform at compile time?

I thought it would auto-detect (from possibly /D Win32) which system it is but I found out it's static. Since there are separate sources for Linux and Windows, and Win32 is previously the only system it ran on there's no need to have it be dynamic. The source designed for Windows, in 32-bit mode... so they just saved time and made it static. Where I pointed out is where to change it You could even write Linux or OS-X and it wouldn't care!

When I try to build a snapshot of PHP for people to use (with all availible extensions) it goes just fine until it tries to build php5ts.dll then it gives me "unresolved external symbol" errors and fails. So close but I don't know how to fix it

I really don't know C either. I know other languages so I can somewhat understand the structure to get all this stuff done. I hope we all can work together and get an Apache/PHP package going that's 64-bit!

I'll have a look into that (PHP),
well i don't know C but shouln't it be posible to detect the platform at compile time?

I thought it would auto-detect (from possibly /D Win32) which system it is but I found out it's static. Since there are separate sources for Linux and Windows, and Win32 is previously the only system it ran on there's no need to have it be dynamic. The source designed for Windows, in 32-bit mode... so they just saved time and made it static. Where I pointed out is where to change it You could even write Linux or OS-X and it wouldn't care!

When I try to build a snapshot of PHP for people to use (with all availible extensions) it goes just fine until it tries to build php5ts.dll then it gives me "unresolved external symbol" errors and fails. So close but I don't know how to fix it

I really don't know C either. I know other languages so I can somewhat understand the structure to get all this stuff done. I hope we all can work together and get an Apache/PHP package going that's 64-bit!

I mailed WROWE from the httpd-dev list on the platform isseu... he said he'll fix in in HEAD 2.3/2.4 and probebly 2.2 aswel.

Yes i'd really like to see a full 64bit php.
In my free time (wich is little atm) i'm trying to get mod_perl to work first... but it needs a 64bit perl and the one on the internet isn't a complete build!

I had no luck compilinh a 32bit or 64bit pel with VS 2005 as of today.

I mailed WROWE from the httpd-dev list on the platform isseu... he said he'll fix in in HEAD 2.3/2.4 and probebly 2.2 aswel.

Yes i'd really like to see a full 64bit php.
In my free time (wich is little atm) i'm trying to get mod_perl to work first... but it needs a 64bit perl and the one on the internet isn't a complete build!

I had no luck compilinh a 32bit or 64bit pel with VS 2005 as of today.

Thanks for the help of trying to reach PHP x64. I've found http://ftp.emini.dk/pub/php/win32/zip.zip which includes all the sources, libraries, and DLLs needed to compile the snapshot build of PHP 5.1.x. However, the DLLs and libraries are all 32-bit. You can compile PHP 5.1.x in 32-bit but not 64-bit with it. I've been working (slowly, but surly) to recompile everything in that ZIP into 64-bit. There may be some that can not be (mSQL.dll perhaps, I doubt you can get the code for that!) so they may not be included in a "full" PHP x64. I've got about 30 libraries already recompiled in 64-bit. Not sure they all work perfectly yet but if we can re-create that Zip.zip file structure in 64-bit I believe a "full" PHP x64 can be built.