Extension memcache in PHP extension library pecl under Windows compilation

Source: Internet
Author: User
Tags php source code vc9

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 database retrieval results, by maintaining a unified, huge hash table in memory. The simple thing is to call the data into memory and then read it from memory, which greatly improves the reading speed.

This article is mainly about compiling PHP and its extended memcache, before reading the following, it is recommended to read the official documentation of the "compile from the source program." Let's take php-5.3.10 as an example.

First, the compilation environment

Choose the appropriate compiler based on 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 and install Windows SDK 6.1 ()//As a command to execute later

Second, compile the file

1, download PHP source code, http://php.net/releases/

2. Download PHP SDK file, http://windows.php.net/downloads/php-sdk/

3. Download memcache extension code package, Http://pecl.php.net/package/memcache

4, after the download is complete these files

Poke here one click Package Download Http://pan.baidu.com/s/1pJ3esav

Third, the compilation work

1. Create the compilation Directory "C:\PHP_SDK"//Create PHP_SDK directory under C Drive

2, unzip the php-sdk-binary-tools-20110915.zip inside the file into the PHP_SDK directory

3. In the Start menu, locate 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 under the directory

4, into the C:\php_sdk\phpdev\vc9\x86\, the deps-5.3-vc9-x86.7z extracted to the directory, overwriting the Deps folder.

5, the PHP source code is also extracted to the x86 directory.

6, create the Pecl folder in the x86 directory, extract the contents of the Memcache compressed package to the PECL directory, and change the folder name memcache-2.2.7 to Memcache

7. Create the obj folder in the x86 directory to save the files generated at compile time

8. Execute the following command to create a 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:--enable-memcache=shared in the configuration means that 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 re-perform the action above

Set path=%path%; C:\php_sdk\bin  

9, compile PHP, execute the following command

Nmake

10. If you want to package PHP, execute the following command

NMAKE Snap

It takes a little time to compile, please be patient and wait for compilation.

Here, the compilation work should be over. Can be found in the C:\php_sdk\phpdev\vc9\x86\obj\ReleaseTS\ directory Php_memcache.dll

Note: This article refers to http://blog.csdn.net/mycwq/article/details/10165955

Extension memcache in PHP extension library pecl under Windows compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.