Skip to content

Instantly share code, notes, and snippets.

@aNd1coder
Last active September 19, 2019 12:57
Show Gist options
  • Save aNd1coder/e28b04f09b8dc11c040a13e57fa74c25 to your computer and use it in GitHub Desktop.
Save aNd1coder/e28b04f09b8dc11c040a13e57fa74c25 to your computer and use it in GitHub Desktop.
Installing PHP REDIS PHP7 Branch On Fresh Install Homestead PHP7 Branch
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!
# https://laracasts.com/discuss/channels/tips/tutorial-guide-installing-php-redis-on-fresh-install-homestead-with-php7
@lichenbuliren
Copy link

fork 一份带走

@markushausammann
Copy link

Hi, the php7 branch doesn't exist anymore. How would this be done now?

@diyezmedia
Copy link

$ git clone -b php7 https://github.com/phpredis/phpredis.git , run after
Cloning into 'phpredis'...
fatal: Remote branch php7 not found in upstream origin
???????????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment