26

Does any one know about a Memcache version that supports PHP7 on Windows?

Memcache is working great for PHP 5.6 (on Windows), but I cannot find the version for PHP7.

Will
  • 24,082
  • 14
  • 97
  • 108
Jens Kirk
  • 526
  • 1
  • 5
  • 19

5 Answers5

37

Please find php_memcache.dll for php7.0.x, php7.1.x, php7.2.x https://github.com/nono303/PHP7-memcache-dll

  • vc14 & vc15
  • x86 & x64
  • ts & nts
nono303
  • 371
  • 3
  • 5
  • Does a version of php_memcache.dll exist for PHP Version 7.0.0, or should the 7.0.6 dll version work for it? – Jeroen Steen Aug 02 '16 at 15:19
  • 1
    the 7.0.6 version should work for 7.0.0. If not, contact me and i'll provide the 7.0.0 compiled version – nono303 Aug 08 '16 at 07:57
  • 1
    i've just add php_memcache.dll build with php 7.1.0 sources. see https://github.com/nono303/PHP7-memcahe-dll#php-71x_memcachedll – nono303 Dec 08 '16 at 13:49
  • You're welcome! VC15 builds added and url change (corrected...) https://github.com/nono303/PHP7-memcache-dll – nono303 Dec 20 '16 at 06:18
  • 1
    Please can we also get sources and dependencies for php_memcache on 7.0.X and PHP 7.1.X to compile it on Windows independently? – VladacusB Apr 10 '17 at 07:06
  • When I attempt to build independently, I get this error: MSVCRT.lib(MSVCR120.dll) : error LNK2005: __snprintf already defined in zlib_a.lib(gzlib.obj) Any ideas what I am missing? @nono303 – Brad Thiessen May 15 '17 at 16:47
  • 1
    @VladacusB : Please refer to https://wiki.php.net/internals/windows/stepbystepbuild for windows build. Use php-src from https://github.com/php/php-src branch to have 7.0.X and PHP 7.1.X independently – nono303 May 18 '17 at 04:25
  • @BradThiessen: Did you have a look at http://stackoverflow.com/questions/2728649/error-lnk2005-xxx-already-defined-in-msvcrt-libmsvcr100-dllc-something-libc ? If not can you detail your MSVC & php-dep package versions? – nono303 May 18 '17 at 04:29
  • Thanks @nono303. I ended up figuring it out! My issue was that I was using VC13. – Brad Thiessen May 18 '17 at 20:42
  • Updated 7.2.x version patched with pull #26 https://github.com/websupport-sk/pecl-memcache/pull/26/ to fix issue #23 https://github.com/websupport-sk/pecl-memcache/issues/23#issuecomment-327702906 :Failed to read session data with 7.1/7.2 – nono303 Jan 19 '18 at 12:38
  • memcache worked for me with windows10 iis. use the OP's link, get the memcache dll you need (mine was the 7.2.x nts x86 one). Also a side note, for nts x86 mssql drivers, check into this link. https://learn.microsoft.com/en-us/sql/connect/php/system-requirements-for-the-php-sql-driver?view=sql-server-2017 – Robot70 Jan 11 '19 at 18:43
8
  1. At first, check phpinfo(), example:
    • Compiler: MSVC14 (Visual C++ 2015)
    • Architecture: x64
    • PHP Extension Build: API20160303,NTS,VC14
  2. Based on information in phpinfo(); choose right dll:
  3. Copy to php_memcache.dll to \PHP\v7.1\ext
  4. Enable php_memcache in php.ini, add line:
    • extension=php_memcache.dll
  5. Check presentation of 'memcache' section in phpinfo();
  6. Check errors.log
4

Here is the dll you can use with your PHP7 Windows installation (64 bit)

https://github.com/Alvine-IO/php7-windows/blob/master/x64/ts/dll/php_memcache.dll

supersan
  • 5,671
  • 3
  • 45
  • 64
4

Just in case if anyone needs dll files - https://github.com/jur4x/PHP7-memcahe-dll. Compiled for PHP 7.0.6, both thread safe and non thread safe versions.

Juris Vaiders
  • 635
  • 8
  • 22
  • How did you compile memcached.lib? When I try to compile, I am getting the error `ERROR: memcached: library 'memcached' not found` – Joyce Babu May 13 '16 at 12:44
  • 1
    PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp64/bin/php/php7.0.23/ext/php_memcache.dll' - %1 is not a valid Win32 application. in Unknown on line 0 – Nikunj Dhimar Jan 23 '18 at 09:39
2

The new memcached extension doesn't work on Windows because libmemcached doesn't work on Windows. However, someone seems to have gotten the old memcache extension to install on Windows. I can't find a nice pre-compiled binary, but, after a lot of digging, I found a PHP Bug Report about this issue. Someone there seems to have found a solution:

[2016-01-20 23:11 UTC] php at alternize dot com

the branch "NON_BLOCKING_IO_php7" of the git repository https://github.com/websupport-sk/pecl-memcache.git builds fine against php 7.0.2 in win32 x86 thread-safe mode. i have not tested it with non-thread-safe and/or x64.

to build the php_memcache.dll, i followed the instructions on https://wiki.php.net/internals/windows/stepbystepbuild#building_pecl_extensions using:

C:\php-sdk\phpdev\vc14\x86\php-7.0.2-src>buildconf
C:\php-sdk\phpdev\vc14\x86\php-7.0.2-src>configure --disable-all 
  --enable-cli --enable-zlib --enable-hash --enable-session 
  --without-gd --with-bz2 --enable-memcache=shared
C:\php-sdk\phpdev\vc14\x86\php-7.0.2-src>nmake
Community
  • 1
  • 1
Will
  • 24,082
  • 14
  • 97
  • 108