Memcache is a high-performance distributed memory object caching system that can be used to store data in a variety of formats, including images, videos, files, and the results of database retrieval, by maintaining a large, unified hash table in memory. It simply means that the data is called into memory and then read from memory, thus greatly increasing the reading speed.
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/
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
Copy Code code as follows:
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
Copy Code code as follows:
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 that the memcache is generated as a DLL, otherwise it is integrated with PHP.
If the prompt bison.exe does not exist, execute the command, and then rerun the action above
Copy Code code as follows:
Set path=%path%; C:\php_sdk\bin
9, compile PHP, execute the following command
Copy Code code as follows:
10, if you want to package PHP, execute the following command
Copy Code code as follows:
Here, the compile work should be over. Php_memcache.dll can be found in the C:\php_sdk\phpdev\vc9\x86\obj\ReleaseTS\ directory