Libmemcached PHP extension in Windows (php_memcached.dll download)

Source: Internet
Author: User
Tags php source code vc9
I. Compile PHP
Requirement: 1. Visual C ++ 2008
2. Windows sdks 6.1
3 binary tools:
: Http://pecl2.php.net/downloads/php-windows-builds/php-libs)
4 win32build http://www.php.net/extra/win32build.zip
5. Other Lib: bindlib, Bison, libxml2, zlib
Download To http://pecl2.php.net/downloads/php-windows-builds/php-libs/VC9/x86/
6. php Source code

Steps:
    1. Create a folder named "D: \ PHP-SDK"
    2. Decompress binary-tools.zip to this directory. After decompression, there are two folders: Bin and script.
    3. Open "Windows SDK 6.1 shell" (start-Program-Windwos sdks 6.1-cmd shell)
    4. Run the following command:

Setenv/x86/XP/release
Cd d: \ PHP-SDK \
Bin \ phpsdk_setvars.bat
Bin \ phpsdk_buildtree.bat php53dev

    1. Decompress the PHP source code to the D: \ PHP-SDK \ php53dev \ vc9 \ x86 directory. The following directories will be created: D: \ PHP-SDK \ php53dev \ vc9 \ x86 \ php5-xyz
    2. There is a "deps" folder in the same directory (D: \ PHP-SDK \ php53dev \ vc9 \ x86). decompress the required library to this folder.
    3. Cd d: \ PHP-SDK \ php53dev \ vc9 \ x86 \ php5-xyz
    4. Buildconf
    5. Configure -- disable-all -- enable-cli
    6. Nmake
    7. The compiled PHP library will be placed under D: \ PHP-SDK \ php53dev \ vc9 \ x86 \ php5-xyz \ norelease_ts
    8. OK

The following problems may occur during PHP Compilation:
(1) Error c2466: cannot allocate an array of constant size 0 http://bugs.php.net/bug.php? Id = 39130
(2) You may need to modify some variable paths in the configure. js file:
Example: php_object_out_dir, php_php_build
Ii. Compile libmemcached
1. Download libmemcached's Windows source Code
2. Use Windows studio 2008 to open
3. libmemcached. dll can be generated after compilation and execution.
3. Compile php_memcached
Requirement: 1. Download cywin
2. Download php_memcached library http://pecl.php.net/package/memcached
Step: 1. Install cywin
2. Switch to the ext directory.
Cd d: \ PHP-SDK \ php53dev \ vc9 \ x86 \ php5-xyz \ ext
3. Modify ext_skel_win32.php:
$ Cygwin_path = 'C: \ cygwin \ bin ';
Modify Your cygwin directory
$ Cygwin_path = 'd: \ cygwin \ bin'
4. Execute the following command to generate the C ++ project file:
PHP ext_skel_win32.php-extname = memcached
5. Copy the source code from the php_memcached library to this project to overwrite the original file.
6. for compiling and running, add the source code path of libmemcached to the compiling path. Add php5ts. lib and libmemcached to the link path to generate the php_memcached.dll file.

4. Add PHP Extension
1. Put php_memcached.dll under php5-xyz \ ext
2. Place libmemcached. dll in c: \ windows.
3. Modify the php. ini statement extension = php_memcached.dll.

Address: http://17drupal.com/comment/152048

 

 

 

Download the file at the command line: wget https://launchpad.net/libmemcached/1.0/1.0.7/+download/libmemcached-1.0.7.tar.gz.

 

2. Enter sudo apt-Get install libevent-Dev to install libevent-Dev (it is said that this is very important, otherwise libmemcached will not run, it is best to install it)

 

3. decompress the downloaded file: Sudu tar-zxvfLibmemcached-1.0.7.tar.gz

 

4. Compile:./configure

 

5. Input: Make

The following error may occur:

Libmemcached/backtrace. CC: In function 'void custom_backtrace ()':
Libmemcached/backtrace. CC: 57: 6: Sorry, unimplemented: graphite loop optimizations can only be used if the libcloog-ppl0 package is installed

The solution is to modify the makefile, find and remove Floop-parallelize-All (there should be two items to be removed), and read the online documents to say that the graphite loop optimization is not used.

Compiled successfully.

 

6. Install: make install

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.