Compile PHP5.4 and Xdebug full record _php techniques under Windows

Source: Internet
Author: User
Tags error handling mssql prepare

In fact, my ultimate goal is to compile the php_xdebug.dll that supports PHP5.4, and before that, the successful compilation of PHP5.4 is necessary.

Compilation environment and related software packages:
1.Microsoft Visual C + + 2008 Express Edition with SP1
2.Windows SDK 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 build environment, then you need to install Visual C + + 6.0, and the SDK needs to be replaced by:
Windows Server 2003 PSDK

Compile process:

Prepare your coffee, cola, and prepare, and you may have to toss for hours ...

Install VC + + 2008 and Windows SDK 6.1

Create the following directory:

Copy Code code as follows:

D:\php-sdk
D:\php-sdk\php54dev
D:\php-sdk\pecl

Unzip all files in Php-sdk-binary-tools-20110915.zip to D:\PHP-SDK
Extract the Deps directory from deps-5.4-vc9-x86.7z to D:\php-sdk\php54dev
Extract php5.4 source to D:\php-sdk\php54dev, directory name, such as PHP-5.4.0RC3
Xdebug Source Stacking to D:\php-sdk\pecl\xdebug

The final directory structure is probably like this:

Copy Code code 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 the Windows SDK CMD Shell, execute: setenv/x86/xp/release, if you are a 64-bit system, then this command is required, do not try to change the parameters to/x64, otherwise the subsequent make phase, you will see thousands of WARNING ...

Set Path:set path=d:\php-sdk\bin;%path%

Switch the SHELL directory to D:\php-sdk\php54dev\php-5.4.0rc3> Execute the buildconf build Configure script:

Copy Code code 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>

Execute configure build make script, you can view configure–help for more compilation options:
Copy Code code 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--without-mssql--without-pdo-mssql-- Without-enchant--enable-com-dotnet--with-mcrypt=static--disable-static-analyze--with-xdebug=shared

Here I used –disable-snapshot-build to turn off the snapshot mode, because the command would force a lot of options for me to be useless, like Aolserver,apache SAPI, and finally I added –with-xdebug =shared, before using this option, it is best to confirm xdebug source location is correct, if there is no problem, buildconf, in configure–help you can see this option, shared represents compiled into a dynamic link library.

If you want to compile other pecl extensions (such as Apc,bcompiler, etc.), just download the relevant source code to the Pecl directory, and then execute buildconf again.

If configure is not a problem, finally NMAKE starts the compilation process, good luck! :)

The last step, NMAKE snap, organizes the directory structure of all compiled files (that is, the structure of the PHP binaries you normally download) and packages them in zip.

Final generated file location: D:\php-sdk\php54dev\php-5.4.0RC3\Release (_TS)

Error handling:
NMAKE will produce a lot of Warning, as long as not interrupted, then ignore the good.

About coding problems with CALENDAR.C and jewish.c:

Copy Code code as follows:

Ext\calendar\calendar.c:warning c4819:the file contains a character that cannot is 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 is 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 use ANSI encoding, which contains some special characters for Latin, and does not exist in the GBK character set.
Available EditPlus open, encoding selection: West European (Windows), Save as UTF-8.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.