Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easiest way to build / obtain php_memcache.dll for PHP 5.4

I'm planning to use Traits, available in PHP 5.4 on our application that requires Memcache and hence php_memcache.dll

I'm developing on a Windows machine using PHP 5.4 latest release candidate.

I am unable to source a PHP 5.4 build of php_memcache.dll so would like to know either how to obtain it or failing that, build it myself (the instructions on http://www.php.net/manual/en/install.windows.building.php seem a little lacking!).

I do not have Visual Studio or any build tools installed on my machine (and ideally do not want to pay for any).

Thanks

like image 769
twiz911 Avatar asked Jan 23 '12 02:01

twiz911


2 Answers

It seems PECL/memcache 3.0.5 and 3.0.6 don't compile properly under Windows (at least not with the instructions provided in PHP's Wiki). Version 2.2.6 does appear to compile properly.

Follow the instructions in the Wiki and use this configure string:

--enable-cli-win32 --disable-zts --disable-isapi --disable-nsapi --without-mssql --without-pdo-mssql --without-pi3web --disable-static-analyze --enable-memcache=shared

That should give you a "php_memcache.dll" compatible with PHP 5.4.0 (VC9, non thread-safe). These options (with some small modifications) were taken from the build configuration of the Win32 binaries provided on PHP.net.

The extension loads without errors in PHP 5.4.0RC6, but I haven't actually (stress-)tested it in any meaningful way...

like image 119
Thijs Putman Avatar answered Nov 20 '22 17:11

Thijs Putman


This doc page explains how to do it: http://php.net/manual/en/install.pecl.windows.php

But the best way to easily achieve this would be to run ubuntu/fedora as a virtual os (using virtualbox). Getting newer versions of any extensions will be way easier under unix.

You could still develop on windows and use a shared directory to run the php code in the linux VM.

like image 2
Martin Samson Avatar answered Nov 20 '22 17:11

Martin Samson