Recently learning to study Redis, so in the local environment to try to start, starting from the installation of Redis, to encounter the heap problem, but also is the only problem, that is: Unable to install the extension!
From the ready to install, we all know that the installation of PHP extensions under Windows, the general idea is to first download a DLL file in the PHP ext directory, Add the extension in php.ini, and then restart Apache, yes, I do, but because I do not know which version of the local environment needs DLL files, so look for a long time to install.
Take a detour not to say, put my last successful steps and notes listed:
Starting with the local environment, the PHP environment under Windows, I used the Wamp, is actually apache2,php5.5.12, first find the relevant Redis package required files from the Internet: http://windows.php.net/downloads/ PECL/SNAPS/REDIS/2.2.5/(a search can find a bunch, very similar, the only thing to note is the version)
Local with phpinfo view, find msvc items, my is MSVC11 (Visual C + + 2012), and the system is 64-bit, so:
That's what I'm using, Php_redis-2.2.5-5.5-ts-vc11-x64.zip.
After downloading there will be some files, find the inside of the Php_redis.dll, copied to the PHP extension directory (depending on the situation, usually in wamp\bin\php\php5.5.12\ext).
Open php.ini Add Extension=php_redis.dll.
Restart Apache, and then look at the phpinfo of localhost and find redis with relevant information (version number, enabled).
Complete.
In the code:
$redis = new Redis ();
$result = $redis->connect (' 127.0.0.1 ', 6379);
Var_dump ($result); Result: BOOL (TRUE)
Success.
Go back to say I go detours, because the next wrong a lot of DLLs, so in Phpinfo, there is no item on Redis, the above code new Redis (); will also error, can not find the class name.
There is no, not very convenient for beginners to learn, you can search the Internet for other graphic tutorials, this text core is to remind the version of the ...
Installation of Redis extensions in Windows PHP Development (WAMP)