ubuntu下php redis扩展无法加载成功
ubuntu12.04, PHP 5.4.9,
我安装了无数次,就是不行,
redis-server和redis-cli终端中可以正常工作(我把端口从默认的6379改成了6380)
查的安装过程差不多都一样:
<code>wget --no-check-certificate http://github.com/nicolasff/phpredis/tarball/master -O phpredis.tar.gz tar phpredis.tar.gz cd nicolasff-phpredis-f1231c9 phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make install 修改php.ini,添加redis.so模块 vim /etc/php5/apache2/php.ini vim /etc/php5/cli/php.ini 都添加下面一行 extension=redis.so 重启apache </code>
当new Redis()的时候还是提示Redis not found。
在此谢过
回复内容:
ubuntu12.04, PHP 5.4.9,
我安装了无数次,就是不行,
redis-server和redis-cli终端中可以正常工作(我把端口从默认的6379改成了6380)
查的安装过程差不多都一样:
<code>wget --no-check-certificate http://github.com/nicolasff/phpredis/tarball/master -O phpredis.tar.gz tar phpredis.tar.gz cd nicolasff-phpredis-f1231c9 phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make install 修改php.ini,添加redis.so模块 vim /etc/php5/apache2/php.ini vim /etc/php5/cli/php.ini 都添加下面一行 extension=redis.so 重启apache </code>
当new Redis()的时候还是提示Redis not found。
在此谢过
predis 你值得拥有!
这个包是原生 PHP 代码写的客户端,不需要编译扩展。
另外你应该是没有找对 真正的 Apache 配置文件
,查看 phpinfo()
的这一行 Loaded Configuration File
,那才是这个系统真正使用的配置文件。
我今晚将会写一篇用 Redis 做缓存的文章,里面将会讲述两种使用方法,敬请期待~

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



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 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 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.

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.

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.

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.

Steps to solve the problem that redis-server cannot find: Check the installation to make sure Redis is installed correctly; set the environment variables REDIS_HOST and REDIS_PORT; start the Redis server redis-server; check whether the server is running redis-cli ping.

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).
