[root@localhost wengpengle]# wget  

 [root@localhost wengpengle]# tar -zxvf 2.2.8.tar.gz  
 [root@localhost wengpengle]# cd phpredis-2.2.8/  
  //执行完这一步(用phpize生成configure配置文件) 会出现下面的错误   根据错误提示 可以看出 没有 php-devel 这个扩展  
  [root@localhost phpredis-2.2.8]# /usr/bin/phpize  

  Can't find PHP headers in /usr/include/php  
  The php-devel package is required for use of this command.  

 //安装 php-devel  会有以下提示   
  [root@localhost phpredis-2.2.8]# yum install php-devel  
  Another app is currently holding the yum lock; waiting for it to exit... 

  //在执行 /usr/bin/phpize  这个密令、意思就是(用phpize生成configure配置文件)、 出现以下提示、说明 OK 了  
   [root@localhost phpredis-2.2.8]# /usr/bin/phpize  
   Configuring for:  
   PHP Api Version:         20100412  
   Zend Module Api No:      20100525  
   Zend Extension Api No:   220100525  

   //查看php-config 的路径  
  [root@localhost phpredis-2.2.8]# whereis php-config  

  php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz  

  [root@localhost phpredis-2.2.8]# ./configure --with-php-config=/usr/bin/php-config  

  //编译并且安装、(出现以下提示说明 OK)  
  [root@localhost phpredis-2.2.8]# make && make instll  
  Build complete.  
  Don't forget to run 'make test'.  

  Installing shared extensions:     /usr/lib64/php/modules/  

 //修改php.ini配置文件 让php支持redis    
 [root@localhost phpredis-2.2.8]#vi /etc/php.ini   
 //在 php.ini 的最后一行加上  


  //重行启动 Apache   
 [root@localhost etc]# systemctl restart httpd 

                BILL ZHANG





4楼  2017-08-08  23:15发表