在homestead php7的ubuntu环境中安装 php redis扩展的方法
2016-05-30 22:08
483 查看
转载:https://laracasts.com/discuss/channels/tips/tutorial-guide-installing-php-redis-on-fresh-install-homestead-with-php7
vagrant@homestead:~$ sudo apt-get update vagrant@homestead:~$ git clone -b php7 https://github.com/phpredis/phpredis.git vagrant@homestead:~$ sudo mv phpredis/ /etc/ vagrant@homestead:~$ cd /etc/phpredis vagrant@homestead:/etc/phpredis$ phpize vagrant@homestead:/etc/phpredis$ ./configure vagrant@homestead:/etc/phpredis$ make && make install Note This is an Extension You Need to Enable to Make it Work in Php 7 This First Command Will Allow You To Call PHPREDIS Facade in Browser vagrant@homestead:/etc/phpredis$ sudo vim /etc/php/7.0/fpm/conf.d/redis.ini Inside Vim Paste this extension=/etc/phpredis/modules/redis.so :w! ->write/save :q ->exit vim NOTE This Extension needs To be Enable in PHP ini to ENABLE it on your Command Line Interface Such As Artisan. The Usual Problem You Will Face If You Wont do this is Get a Redis Class Not Found vagrant@homestead:/etc/phpredis$ sudo vim /etc/php/7.0/cli/php.ini then Look for this Word CLI Server Type /CLI Server Add to the last line of extension extension=/etc/phpredis/modules/redis.so :w! ->write/save :q ->exit vim vagrant@homestead:/etc/phpredis$ sudo service php7.0-fpm restart vagrant@homestead:/etc/phpredis$ sudo service nginx restart To Test if PhpRedis Extension is Working php -r "if (new Redis() == true){ echo \"\r\n OK \r\n\"; }" It Should Return OK!
相关文章推荐
- 底层实现-intset 整数集合
- 浅析Redis复制
- Redis安装之Windows
- NoSQL之Redis---下载与安装
- Redis 复制
- NoSql之Redis数据类型
- 安装redis和php的redis扩展
- 一致性Hash算法在Redis分布式中的使用
- Redis 代理服务Twemproxy
- 使用Spring Session和Redis管理session
- Redis Windows版安装及整合Spring
- nginx+tomcat+redis集群环境搭建
- Redis和MongoDB的关系
- Linux安装Redis
- Redis使用优化技巧(java)
- 基于Redis Sentinel的Redis集群(主从&Sharding)高可用方案
- redis之(十六)redis的cluster集群环境的搭建,转载
- windows下使用Redis存储
- centos 6.x redis设置启动
- redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'SENTINEL'