Compile builds with PHP5.6 source code under Windows 7 (most detailed steps)

Source: Internet
Author: User
Tags php website php windows vc9

After a few days of detours, and finally the normal compilation of PHP5.6, make a record convenient back-browsing.

First, the preparation of raw materials

1, in the PHP Windows website to download: Http://windows.php.net/download. What I chose here is the php5.6.25.

2, download VC + + compilers. The current official website different PHP version requires a different version of VC + + compiler:, Detailed View Https://wiki.php.net/internals/windows/compiler.

Official online php5.5,5.6 can be used with Express version: Visual Studio-Express for Windows Desktop


Below is the version of the VC supported by the PHP website

Product Name 5.2.x 5.3.x 5.4.x 5.5.x 5.6.x 7.0.x 64bits (* *)
Visual C + + 6 (SP6 only) Yes Yes No No No No No
Visual C + + 7/7.1 (2002, 2003, 2003+SP1) Yes (* *) Yes (* *) No No No No No
Visual C + + 8 (2005) Yes (* *) No No No No No No
Visual C + + 9 (SP1 only) Yes (* *) Yes Yes Yes (* *) No No No
Visual C + + 11 (2012) No No Yes (* *) Yes Yes Yes (* *) Yes
Visual C + + 14 (2015) No No No No No Yes Yes


3, need to download PHP SDK package and Deps package


at the URL:http://windows.php.net/downloads/php-sdk/can see the latest supported packages

Currently I use the 32-bit, so use x86.


deps:http://windows.php.net/downloads/php-sdk/deps-5.6-vc11-x86.7z


SDK (with latest option): Http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip


Second, installation steps

1, install the visual stdio first.

2. Put sdk,deps,src three packages into a specified directory, such as D:/php_compiler

3, first unpack the SDK package, generate three directories, respectively, Bin,script,share

4. From the Start menu Mircrosoft Visual Stdio 2012/visual Studio 2012 Find the vs. X86 Native command prompt, go to the prompt

5, through the command prompt, back to D:/php_compiler.

6, run Bin\phpsdk_setvars.bat, the bat file in order to add the current directory (D:/php_compiler/bin) to the default path (System path), so that the command in the Bin directory can be used at the command prompt.

7, run Bin\phpsdk_buildtree.bat php_dev, generate Php_dev directory, you can expand to see the command pre-generated some necessary directory structure. such as VC6,VC8,VC9. But without vc11, we copied vc9 directly into VC11, or renamed it directly to Vc11

8, put the Php-5.6-src.zip package to vc11/x86/, and extract it out, and then Deps.zip decompression after the merger with Vc11/x86/deps.

9. Go to the VC11/X86/PHP-5.6-SRC directory via the command prompt just now

10, through Buildconfig and configure.bat-disable-all-enable-cli (parameter configuration through Configure.bat-help view, according to their own needs) to generate makefile files.

11. Run NMAKE, generate PHP.EXE

12. Packaging, NMAKE snap. Generate Php-5.6-devel-vc11.zip.

13. Done


Third, the pits encountered

1, always prompt system can not find the specified path appears fatal error U1077: "If": Return code "0x01"

Workaround: Compile with Administrator user

2. NMAKE could not find

FIX: Add both directories of Microsoft Visual Stdio 11.0\vc\bin and Microsoft Visual\commond7\ide\ to system variables (path)


This article is from "Happy Like Water" blog, please be sure to keep this source http://lailaiji.blog.51cto.com/1790290/1842385

Compile builds with PHP5.6 source code under Windows 7 (most detailed steps)

Related Article

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.