PHP5.4 and xdebug are compiled in Windows.
In fact, my ultimate goal is to compile php_xdebug.dll that supports PHP5.4. Before that, it is necessary to compile PHP5.4 successfully.
Compiling environment and related software packages:
1. Microsoft Visual C ++ 2008 Express Edition with SP1
2. Windows sdks 6.1
3. php sdk Binary Tools
4. Dependable libs
5. PHP5.4 Sources
6. Xdebug 2.2.0-dev
If you need a VC6 compiling environment, you need to install Visual C ++ 6.0, and the SDK needs to be replaced:
Windows Server 2003 PSDK
Compilation process:
Preparing coffee and cola may take several hours...
Install VC ++ 2008 and Windows SDK 6.1
Create the following directory:
Copy codeThe Code is as follows:
D: \ php-sdk
D: \ php-sdk \ php54dev
D: \ php-sdk \ pecl
Decompress all files in the php-sdk-binary-tools-20110915.zip to D: \ php-sdk
Extract the deps directory from the deps-5.4-vc9-x86.7z to D: \ php-sdk \ php54dev
Decompress php5.4 source code to D: \ php-sdk \ php54dev, directory name, such as php-5.4.0RC3
Put the xdebug source code in D: \ php-sdk \ pecl \ xdebug
The final directory structure is like this:
Copy codeThe Code is as follows:
D: \ php-sdk> tree D: \ php-sdk
Folder PATH listing for volume DISK_VOL2
Volume serial number is 0C74-AD73
D: \ PHP-SDK
── Bin
── Php54dev
│ ── Deps
│ ── Bin
│ ── Include
│ ── Lib
│ ── Sybase
│ ├ ── Pecl
│ ── Xdebug
│ └ ── Php-5.4.0RC3
── Script
── Share
Open Windows sdk cmd Shell and execute: setenv/x86/xp/release. If you are a 64-bit system, this command is required. Do not change the parameter to/x64, otherwise, in the subsequent make stage, you will see thousands of logs...
Set PATH: set PATH = D: \ php-sdk \ bin; % PATH %
Switch the SHELL directory to D: \ php-sdk \ php54dev \ php-5.4.0RC3> and execute buildconf to generate the configure script:
Copy codeThe Code is as follows:
D: \ php-sdk \ php54dev \ php-5.4.0RC3> buildconf
Rebuilding configure. js
Now run 'configure -- help'
D: \ php-sdk \ php54dev \ php-5.4.0RC3>
Run configure to generate the Make script. You can view configure-help to get more compilation options:
Copy codeThe Code is as follows:
D: \ php-sdk \ php54dev \ php-5.4.0RC3> configure -- disable-snapshot-build -- disable-debug-pack -- disable-ipv6 -- disable-zts -- disable-isapi -- disable-nsapi -- without-t1lib -- -mssql -- without-pdo-mssql -- without-pi3web -- without-enchant -- enable-com-dotnet -- with-mcrypt = static -- disable-static-analyze -- with-xdebug = shared
Here I used-disable-snapshot-build to disable the snapshot mode, because this command will force many useless options for me, such as aolserver and apache sapi, finally, I added-with-xdebug = shared. before using this option, we 'd better confirm that the xdebug source code is in the correct position. If there is no problem, after buildconf, in configure-help, you can see this option. shared indicates compiling to a dynamic link library.
If you want to compile other pecl extensions (such as apc and bcompiler), you only need to download the relevant source code to the pecl directory and re-Execute buildconf.
If configure is correct, run nmake to start the compilation process. Good Luck! :)
In the last step, nmake snap organizes the directory structure of all compiled files (that is, the structure of the PHP binary package that you download at ordinary times) and packs it with zip.
Location of the final generated file: D: \ php-sdk \ php54dev \ php-5.4.0RC3 \ Release (_ TS)
Error handling:
There will be a lot of warnings in the nmake process. As long as there is no interruption, it will be ignored.
About the encoding of calendar. c and jewish. c:
Copy codeThe Code is as follows:
Ext \ calendar. c: warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
Dow. c
Easter. c
French. c
Gregor. c
Jewish. c
Ext \ calendar \ jewish. c: warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
Ext \ calendar \ jewish. c (324): error C2001: newline in constant
Ext \ calendar \ jewish. c (325): error C2001: newline in constant
Ext \ calendar \ jewish. c (326): error C2001: newline in constant
Ext \ calendar \ jewish. c (327): error C2001: newline in constant
NMAKE: fatal error U1077: '"C: \ Program Files (x86) \ Microsoft Visual Studio 9.0 \ VC \ Bin \ cl.exe"': return code '0x2'
Stop.
These two files are ANSI encoded and contain some special characters in Spanish. The GBK character set does not exist.
Open with editplus, code Selection: West European (Windows), save as UTF-8.