Compile PHP with source code in Windows

Source: Internet
Author: User
Before you begin, you need to prepare the following: MicrosoftVisualC ++. we recommend that you use Visual C ++ 2008, quick or Professional Edition. WindowsSDK,: http://www.microsoft.com/downloads/details.aspx? FamilyIdF26B1AA4-7 seaprince.cn preparation before start

Before you start, you need to prepare the following:

  1. Microsoft Visual C ++, Visual C ++ 2008, quick or Professional Edition is recommended.
  2. Windows SDK,: aspx? FamilyId = F26B1AA4-741A-433A-9BE5-FA919850BDBF & displaylang = en ">Http://www.microsoft.com/downloads/details.aspx? FamilyId = F26B1AA4-741A-433A-9BE5-FA919850BDBF & displaylang = enIt is not recommended to use that network for installation. it is too slow to complete. We also recommend that you install all of them.
  3. Other tools ,:Http://pecl2.php.net/downloads/php-windows-builds/php-libs/binary-tools.zip
Compilation steps
  1. Download and install VC ++ 2008.
  2. Install windows sdk 6.1
  3. Download php5.3 ,:Http://cn.php.net/get/php-5.3.0.tar.bz2/from/this/mirror
  4. Create a folder, such as C: php-sdk
  5. Decompress the package downloaded in step 3 here. after the package is decompressed, the C: php-sdk should contain two subdirectories: bin and script.
  6. Open Microsoft Windows SDK v6.1/CMD Shell in the Start menu and enter the following command:
    Setenv/x86/xp/release
    Cd c: php-sdk
    Binphpsdk_setvars.bat
    Binphpsdk_buildtree.bat php53dev
  7. Some directories will be created in the previous step. Go to vc9x86, decompress php5.3.0 here, and unzip the directory structure: vc9x86php5.3.0
  8. Enter:
    Cd C: php-sdkphp53devvc9x86php5.3.0
    Buildconf
  9. In this step, it is almost the same as in linux. you can check the compilation options for help:
    Configure? Help
  10. Well, let's make a minimal compilation:
    Configure? Disable-all? Enable-cli
    Nmake
  11. This step is correct on php wiki, but the following error is reported because we are in a Chinese environment:
  12. Use Editplus to open the extstandardrowscap. c file,

    Select yes and select Western European (Windows)
    Then save it as UTF-8 encoding.
  13. RepeatNmakeCompile and then useNmake snapCompiled into the final binary package. The binary package is in the php-5.3.0Release_TS. The name is php-5.3.0-win32-vc9-x86.zip.
  14. Test:

Next article describes how to compile the pecl extension.

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.