Installation of Redis extensions in Windows PHP Development (WAMP)

Source: Internet
Author: User
Tags phpinfo

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)

Related Article

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.