Table of Contents
Preparation
Build environment
Building steps
Modify and recompile
Home Backend Development PHP Tutorial Build your own PHP (php5.3+) on the windows platform_PHP tutorial

Build your own PHP (php5.3+) on the windows platform_PHP tutorial

Jul 20, 2016 am 11:14 AM
https php windows exist article Construct of translate my own

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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440292.htmlTechArticleThis 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...
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1243
24
PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

Choosing Between PHP and Python: A Guide Choosing Between PHP and Python: A Guide Apr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Python: A Deep Dive into Their History PHP and Python: A Deep Dive into Their History Apr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP's Impact: Web Development and Beyond PHP's Impact: Web Development and Beyond Apr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

The Continued Use of PHP: Reasons for Its Endurance The Continued Use of PHP: Reasons for Its Endurance Apr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! Apr 17, 2025 pm 09:54 PM

In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

See all articles