# How to compile PHP 5.3 and PHP 5.4 release x64 with Visual Studio 2008 SP1? [closed]

I have successfully compiled Apache x64 then I use PHP 5.3.29 and 5.4.45 release x86 on it and get error that DLL files are not a valid Win32 application. I installed Visual Studio 2008 SP1, Visual C++ 2008 (x64 and x86).

List of files that I use:

1, `php-5.3.29-src.zip` and `php-5.4.45-src.zip` I took it on windows.php.net

2, `instantclient-sdk-win64-10.2.0.5.zip` and `instantclient-sdk-windows.x64-11.2.0.4.0.zip` on Oracle.

Compile steps:

``````call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 (I tried using the commands in Visual Studio Tools, it also got the same error)
cd /D C:\php-sdk (I extracted the source file and renamed the directory into php-sdk)
buildconf --force
configure --enable-snapshot-build --disable-isapi --enable-debug-pack --without-mssql --without-pdo-mssql --without-pi3web --with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared --with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared --enable-object-out-dir=../obj/ --enable-com-dotnet=shared --with-mcrypt=static --disable-static-analyze
``````
1. The above command I took from the command line of php released x86 on `phpinfo()`.
2. I unzipped `instantclient-sdk-win64-10.2.0.5.zip` then created an `oracle` directory in `php-sdk`, moved the extracted folder, and then renamed it to `instantclient10`.
3. `instantclient11` I got it from `instantclient-sdk-windows.x64-11.2.0.4.0.zip`, doing the same thing as above.

Then use: `nmake snap`

But I encountered an error:

``````c:\php-sdk\zend\zend_execute.h(234) : warning C4267: 'function' : conversion fro
m 'size_t' to 'int', possible loss of data
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\x86_amd64\cl.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\nmake.exe"' : return code '0x2'
Stop.
``````

Then I tried removing `--enable-snapshot-build` on `configure`, this time I just used `nmake`. And I encountered another error:

``````ext\mysqlnd\mysqlnd_net.c(31) : fatal error C1083: Cannot open include file: 'zl
ib.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\x86_amd64\cl.exe"' : return code '0x2'
Stop.
``````

I think the problem is related to zlib, I added `--disable-zlib` to `configure`. This time, the construction process succeeds. However, I only get `php5ts.dll`, `php_com_dotnet.dll`, `php_oci8.dll`, `php_oci8_11g.dll`, `php.exe` and `php-cgi.exe`. There is no DLL files in `root` (build output directory) and `ext` folder.

Can someone give me a complete build guide like x86 release?