


Build your own PHP (php5.3+) on the windows platform_PHP tutorial
This is a translated article, the original text can be found at: https://wiki.php.net/internals/windows/stepbystepbuild
By the way, wiki.php.net has a lot of exciting content. Students who want to learn more about php should not miss it:)
Preparation
Compiling php on the windows platform requires three preparations:
1. A suitable compilation environment, including installing a compiler, the correct SDK and the corresponding binary tools
2. The third library and header files needed to compile PHP
3, PHP source code
Build environment
This is the most difficult part of compiling PHP on Windows platform, because setting up such a compilation environment requires a lot of disk space, which may be several G
Requirements:
- Microsoft Visual C++, the official PHP version supports VC++6.0 and VC++9.0 (ie VC++2008), the Express version is also available. MinGW and other compilers are not supported.
- The correct windows SDK or Platform SDK. The SDK needs to correspond to the VC version. For details, see https://wiki.php.net/internals/windows/windowssdk
- Binary tools used during compilation, see http://windows.php.net/downloads/php-sdk/
Note:
The latest php5.5 can be compiled with VC++9 or VC++11, but 5.5 has not been officially released yet.
If you are using VC6, you need to install Windows Server Feb.2003 SDK. If you are using VC9, you need to install SDK6.1
Building steps
1, install vs2008
2, install windows sdk 6.1
3. Get the source code of php 5.3, you can get the snapshot from here (don’t unzip it first)
4, create the folder c:php-sdk
5. Unzip binary-tools.zip to the c:php-sdk folder. binary-tools.zip is available here (http://windows.php.net/downloads/php-sdk/). After decompression, C:php-sdk should contain subdirectories such as bin, script, share, etc.
6. Open windows sdk 6.1 shell and directly follow the following command:
PHP 5.2, 5.3 and 5.4:
setenv /x86 /xp /release
PHP 5.5+:
setenv /x86 /2008 /release
7,
cd c:php-sdk
8,
binphpsdk_setvars.bat
9,
binphpsdk_buildtree.bat php53dev
10. Now unzip the snapshot downloaded in step 3 to the C:php-sdkphp53devvc9x86 folder. After decompression is completed, the directory path will look like C:php-sdkphp53devvc9x86php5.3-xyz.
11. In C:php-sdkphp53devvc9x86, there is a deps folder. Download some libraries that compilation depends on and extract them into them. These libraries are available from http://wiki.php.net/internals/windows/libs. Make sure that after decompression is complete, the /include and /lib directories are included in deps. (Note: The author downloaded deps-5.3-vc9-x86.7z directly from http://windows.php.net/downloads/php-sdk/ and it can be compiled successfully)
12, continue to run in windows-sdk-shell
cd C:php-sdkphp53devvc9x86php5.3-xyz
13,
buildconf
14, view compilation options
configure --help
15, enter the build instructions according to your needs:
configure --disable-all --enable-cli compiles the simplest PHP kernel and only supports cli running mode
(Note: Some extensions require lib, header files and even other programs. For details, see libs. Download the version you need and extract it to the deps folder c:php-sdkphp53vc9x86deps)
16,
nmake
17, if you need to compress the compiled php file, continue to execute:
nmake snap
18. The compiled PHP is located in the C:php-sdkphp53devvc9x86php5.3-SNAPSHOTTIMERelease_TS directory.
Modify and recompile
1, clear the last compilation result
nmake clean
2, if you need to reconfigure
buildconf --force
3. Enter the new configure configuration
configure --disable-all --enable-cli --enable-$remains
4, compile
nmake
If you only compile the most streamlined PHP (only enable-cli), after the compilation is successful, you can observe which EXT and SAPI are compiled:
In addition to standard (standard extension), this php version only contains date, ereg, pcre, reflection, and SPL extensions. Their source codes can be found in php-src/ext.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

Detailed explanation and installation guide for PiNetwork nodes This article will introduce the PiNetwork ecosystem in detail - Pi nodes, a key role in the PiNetwork ecosystem, and provide complete steps for installation and configuration. After the launch of the PiNetwork blockchain test network, Pi nodes have become an important part of many pioneers actively participating in the testing, preparing for the upcoming main network release. If you don’t know PiNetwork yet, please refer to what is Picoin? What is the price for listing? Pi usage, mining and security analysis. What is PiNetwork? The PiNetwork project started in 2019 and owns its exclusive cryptocurrency Pi Coin. The project aims to create a one that everyone can participate

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public

Ouyi OKX, the world's leading digital asset exchange, has now launched an official installation package to provide a safe and convenient trading experience. The OKX installation package of Ouyi does not need to be accessed through a browser. It can directly install independent applications on the device, creating a stable and efficient trading platform for users. The installation process is simple and easy to understand. Users only need to download the latest version of the installation package and follow the prompts to complete the installation step by step.
