Compile PHP from source code under Windows_PHP tutorial

WBOY
Release: 2016-07-13 17:34:50
Original
1109 people have browsed it

seaprince.cn

Preparation before starting

Before you start, you need to prepare the following things:

  1. Microsoft Visual C++, it is recommended to use Visual C++ 2008, Express Edition or Professional Edition.
  2. Windows SDK, download address: aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyId= F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en It is not recommended to use that network to install, it is too slow, and I don’t know when it will be completed. Also, it is recommended to install them all.
  3. Other tools, download address: http://pecl2.php.net/downloads/php-windows-builds/php-libs/binary-tools.zip

Compilation steps

  1. Download and install VC++ 2008, and install it.
  2. Install windows sdk 6.1
  3. Download php5.3, download address: http://cn.php.net/get/php-5.3.0.tar.bz2/from/this/mirror
  4. Create a folder, such as C:php-sdk
  5. Extract the package downloaded in the third step above here. After decompression, there should be two subdirectories in C:php-sdk: bin, script
  6. Open Microsoft Windows SDK v6.1/CMD Shell in the start menu and enter the command:
    setenv /x86 /xp /release
    cd c:php-sdk
    binphpsdk_setvars.bat
    binphpsdk_buildtree.bat php53dev
  7. The previous step will create some directories. Enter vc9x86 and decompress php5.3.0 here. The directory structure after decompression is: vc9x86php5.3.0
  8. Enter at the command line of WIN-SDK:
    cd C:php-sdkphp53devvc9x86php5.3.0
    buildconf
  9. At this step, it is almost the same as under Linux. You can take a look at the compile option help:
    configure –help
  10. Okay, let’s do a minimal compilation:
    configure –disable-all –enable-cli
    nmake
  11. This step is no problem on PHP wiki, but since we are in a Chinese environment, the following error will be reported:
  12. Open the extstandard rowscap.c file with Editplus,

    select Yes, and select Western European (Windows)
    and save it as UTF-8 encoding.
  13. Recompile nmake, and then use nmake snap to compile into the final binary package. The binary package is under php-5.3.0Release_TS. A possible name is php-5.3.0-Win32-VC9-x86.zip
  14. Test it:

The next article will be about how to compile the pecl extension.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/508461.htmlTechArticleseaprince.cn Before you start, you need to prepare the following things: Microsoft Visual C++, Visual C++ 2008 is recommended, Both Express and Professional versions are available. Windows SDK, download address:...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template