Table of Contents
Request
Essential knowledge
Operating environment
Download address
Home Backend Development PHP Tutorial Install phpredis module on windows platform

Install phpredis module on windows platform

Aug 08, 2016 am 09:26 AM
dll php phpredis redis windows

Request

    • Essential knowledge

      Familiar with basic programming environment setup.

    • Operating environment

      windows 7(64-bit);
      php-5.3
      redis64-2.8.17

    • Download address

      Environment download

What is PHP Redis

PHP Redis is a PHP module written in C language, used to connect and operate data on the Redis database.

Download

  • Download address: https://github.com/phpredis/phpredis/downloads

You need to pay attention to the version number here. It depends on personal circumstances. I downloaded php_redis-5.3-vc9-ts-73d99c3e.zip

Use the phpinfo() function to view information about the current PHP version

Install extension

Extract the downloaded compressed package, and then copy the *.dll module to the PHP ext folder. The 5.3 package only contains the php_redis.dll module, while the 5.4 package contains both php_redis.dll and php_igbinary.dll.

Modify PHP.ini file:

5.3 package introduces the following code

The 5.4 package introduces the following two modules:

PS: extension=php_igbinary.dll must be placed in front of extension=php_redis.dll, otherwise this extension will not take effect

Test

Restart the web server.

Enter the following code in the redis.php file:

<?<span>php
</span><span>$redis</span> = <span>new</span><span> Redis();
</span><span>$redis</span>->connect("localhost","6379"<span>);
</span><span>$redis</span>->set("string","Hello World"<span>);
</span><span>echo</span> <span>$redis</span>->get("string"<span>);
</span>?>
Copy after login

Test in the browser. What needs to be noted here is that the reids service must be started. Regarding the installation of Redis on the Windows platform, you can refer to an article I wrote before.

  • edis for windows

If the above article or link is helpful to you, don’t forget to click the “Not bad” button at the end of the article or click the “Like” button in the lower right corner of the page. You can also click the "Share" floating button on the right side of the page to let more people read this article.

Author: Li-Cheng

Weibo: http://weibo.com/licheng0426

Source: http://www.cnblogs.com/Li-Cheng/p/4391337.html

Due to my limited level, if there are any inaccuracies in the expression and code of the article, I welcome criticism and correction. Leave your footprints and comments are welcome. You can also follow me and learn together!

(^_^) If you think this article is helpful to you, please give it a reward and drink coffee, okay (^_^)

The above introduces the installation of the phpredis module on the windwos platform, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

The Future of PHP: Adaptations and Innovations The Future of PHP: Adaptations and Innovations Apr 11, 2025 am 12:01 AM

The future of PHP will be achieved by adapting to new technology trends and introducing innovative features: 1) Adapting to cloud computing, containerization and microservice architectures, supporting Docker and Kubernetes; 2) introducing JIT compilers and enumeration types to improve performance and data processing efficiency; 3) Continuously optimize performance and promote best practices.

How to build the redis cluster mode How to build the redis cluster mode Apr 10, 2025 pm 10:15 PM

Redis cluster mode deploys Redis instances to multiple servers through sharding, improving scalability and availability. The construction steps are as follows: Create odd Redis instances with different ports; Create 3 sentinel instances, monitor Redis instances and failover; configure sentinel configuration files, add monitoring Redis instance information and failover settings; configure Redis instance configuration files, enable cluster mode and specify the cluster information file path; create nodes.conf file, containing information of each Redis instance; start the cluster, execute the create command to create a cluster and specify the number of replicas; log in to the cluster to execute the CLUSTER INFO command to verify the cluster status; make

PHP: Is It Dying or Simply Adapting? PHP: Is It Dying or Simply Adapting? Apr 11, 2025 am 12:13 AM

PHP is not dying, but constantly adapting and evolving. 1) PHP has undergone multiple version iterations since 1994 to adapt to new technology trends. 2) It is currently widely used in e-commerce, content management systems and other fields. 3) PHP8 introduces JIT compiler and other functions to improve performance and modernization. 4) Use OPcache and follow PSR-12 standards to optimize performance and code quality.

How to implement the underlying redis How to implement the underlying redis Apr 10, 2025 pm 07:21 PM

Redis uses hash tables to store data and supports data structures such as strings, lists, hash tables, collections and ordered collections. Redis persists data through snapshots (RDB) and append write-only (AOF) mechanisms. Redis uses master-slave replication to improve data availability. Redis uses a single-threaded event loop to handle connections and commands to ensure data atomicity and consistency. Redis sets the expiration time for the key and uses the lazy delete mechanism to delete the expiration key.

How to view all keys in redis How to view all keys in redis Apr 10, 2025 pm 07:15 PM

To view all keys in Redis, there are three ways: use the KEYS command to return all keys that match the specified pattern; use the SCAN command to iterate over the keys and return a set of keys; use the INFO command to get the total number of keys.

How to read the source code of redis How to read the source code of redis Apr 10, 2025 pm 08:27 PM

The best way to understand Redis source code is to go step by step: get familiar with the basics of Redis. Select a specific module or function as the starting point. Start with the entry point of the module or function and view the code line by line. View the code through the function call chain. Be familiar with the underlying data structures used by Redis. Identify the algorithm used by Redis.

How to use the redis command How to use the redis command Apr 10, 2025 pm 08:45 PM

Using the Redis directive requires the following steps: Open the Redis client. Enter the command (verb key value). Provides the required parameters (varies from instruction to instruction). Press Enter to execute the command. Redis returns a response indicating the result of the operation (usually OK or -ERR).

See all articles