Php+redis not paying attention to these details is simply jumping into an out-of-place pit (installed under Windows)

Source: Internet
Author: User
Tags php redis phpinfo zip extension
Straight to ~~~~~~~.

The first thing to do! Confirm Version! Be sure to confirm your PHP version!

Phpinfo See what your current version is, my version is now

In several areas of red, you can see that VC11 TS x86 three key words:
VC11: Intended for this version of PHP for the VC11 library ;
TS: Thread-safe NTS non-thread safe (at that time here, the card took me an afternoon, just because the downloaded stuff didn't pay attention to this!!!!! );
The difference between thread-safe and non-thread-safe (I looked for it from the Internet, for more information, portal)

The first Windows version of PHP3.0.17, released on October 20, 2000, started with a thread-safe version, because unlike the Linux/unix system, which works in a multi-process manner, Windows systems work in a multi-threaded way. It is very slow to run PHP as CGI under IIS, because the CGI pattern is built on a multi-process basis, not multithreaded.

In general, we will configure PHP to run in ISAPI way, ISAPI is multi-threaded way, so much faster. There is a problem, however, that many commonly used PHP extensions are developed with Linux/unix's multi-process thinking, which can be faulted when running in ISAPI mode. Therefore, the CGI mode under IIS is the safest way to run PHP, but the CGI mode requires reloading and uninstalling the entire PHP environment for each HTTP request, which consumes a huge amount.

To take into account the efficiency and security of PHP under IIS, Microsoft has given the fastcgi solution. FastCGI can allow the PHP process to be reused instead of every new request to re-open a process. FastCGI can also allow several processes to execute simultaneously. This solves the problem that the CGI process pattern consumes too much, and the CGI process pattern does not have the advantage of the thread security problem.

Therefore, if you are using ISAPI to run PHP, you must use the thread safe version, while running PHP in fastcgi mode, there is no need to use thread security, with none thread safe (NTS, non-thread-safe) Version to better improve efficiency.

Architecture x86: PHP architecture is 32 bits (some simple introduction to some PHP architectures and kernels look at the portal )

Get ready for the above work, let's get the Redis extension back because my PHP version is vc11 TS So I'm under the thread-safe version of the

Download back to Php_igbinary-1.2.1-5.5-ts-vc11-x86.zip extension


Download back to Php_redis-2.2.5-5.5-ts-vc11-x86.zip extension

Download back to Redis-2.4.5-win32-win64.zip (this portal in the installation package decompression, there are two versions, with the same number of system bits, note that the number of system bits , not the number of PHP architecture )

The preparation is complete! Enter the installation steps below

The first step is to extract the Redis installation package into any folder. • You just take him as a software. (I am here to install the F-drive)

Open cmd Interface type command

Do not close this window, now this CMD window has become the service side of Redis

Then open a DOS window and type the command

Command parsing:

Redis-cli.exe-h 127.0.0.1-p 6379

Redis-cli.exe starting the Redis client

-H Host Address

-P Redis Port number (default 6379)

Next Test.

Command parsing

Set Key Name value

The Get key name will output the corresponding value of the key name

Well, Redis is installed, let's install the PHP redis extension

Unzip the two files that we got back from the beginning, copy the. DLL file into the PHP launcher under the Ext folder

Mine is here I use the integrated WAMP environment corresponding to their own PHP installation location, put in this extension directory is good

After putting it in open php.ini add (position casually, I put it at the end of the document)

;p Hp_redis
Extension=php_igbinary.dll
Extension=php_redis.dll

Restart Wamp all services and print again Phpinfo

Seeing this means that the Redis extension is mounted successfully!

Hope this document can help you!

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.