This is a brief introduction to compiling PHP and its extended memcache, and it is recommended that you read the official document (address) before reading the following. Here we take php5.3 as an example.
First, the compilation environment
Select the appropriate compiler according to your PHP version:
PHP 5.3-5.4:visual C + + 9.0 (Visual Studio 2008)
PHP 5.5+: Visual C + + 11.0 (visual Studio 2012)
If it is php5.3-5.4, also download windows SDK 6.1 (download address)
Second, compile the file
1, download PHP source code, http://snaps.php.net/
2, download the PHP SDK file, http://windows.php.net/downloads/php-sdk/
So here we download the two files.
3, download Memcache expansion code package, Http://pecl.php.net/package/memcache
Third, the compilation work
1, create the compilation directory "C:\PHP_SDK"
2, decompression php-sdk-binary-tools-20110915.zip inside the file to php_sdk directory
3, in the Start menu to find and open the Windows SDK CMD Shell, and then execute
Setenv/x86/xp/release
CD PHP_SDK
Bin\phpsdk_setvars.bat
Bin\phpsdk_buildtree.bat Phpdev
After execution, the Phpdev folder is generated in the directory
4, into the C:\php_sdk\phpdev\vc9\x86\, deps-5.3-vc9-x86.7z extract to the directory, cover deps folder.
5, the PHP source code is also extracted into the x86 directory.
6, in the x86 directory to create a pecl folder, the Memcache compressed package content to the PECL directory, and the folder name memcache-2.2.7 changed to Memcache
7. Create obj folder in x86 directory to save compile-time generated files
8. Execute the following command to create the PHP compilation configuration
CD phpdev\vc9\x86\php5.3-201308211030
Buildconf
Configure--help. \configure_help.txt
Configure--disable-all--enable-snapshot-build--enable-cli--enable-cgi--enable-memcache=shared-- Enable-object-out-dir=.. \obj--enable-session
Note: The –enable-memcache=shared in the configuration means memcache to build the DLL, otherwise it will be packaged with PHP
9, compile PHP, execute the following command
Nmake
10, if you want to package PHP, execute the following command
NMAKE Snap
Here, the compile work should be over. Php_memcache.dll can be found in the C:\php_sdk\phpdev\vc9\x86\obj\ReleaseTS\ directory
Iv. concluding remarks
This article describes how to compile PHP and its own PHP extensions, and make a distinction between compiling PHP extensions eaccelerator under Windows written earlier. You can also generate which PHP extensions, depending on the x86 directory just generated help document Configure_help.txt
Original from: Lvtao.net blog