Install composer before installing the Predis extension, install the tutorial in https://getcomposer.org/download/:
" copy (' Https://getcomposer.org/installer ', ' composer-setup.php '); " "if (hash_file (' SHA384 ', ' composer-setup.php ') = = =" C32408bcd017c577ce80605420e5987ce947a5609e8443dd72cd3867cc3a0cf442e5bf4edddbcbe72246a953a6c48e21 ') {echo ' Installer verified '; } else {echo ' Installer corrupt '; unlink (' composer-setup.php ');} echo php_eol; " php composer-"unlink (' composer-setup.php '); "
Then set the composer Global environment variable:
MV Composer.phar/bin/composer
Composer Mirror address to the domestic will be much faster, tutorial address: http://pkg.phpcomposer.com/
Composer Config-g Repo.packagist composer https://packagist.phpcomposer.com
Then turn on the Php-pear,php-devel and Php-redis extensions, and I'll install the extensions directly with the CentOS Yum package:
Yum Install php70w-devel.x86_64yuminstall php70w-pear.noarchYum Install
After the installation is complete, switch to the root directory of your site after success:
Composer require predis/predisusing version^1.1 forpredis/Predis./Composer.json has been updated> PHP ArtisanClear-compiledloading composer repositories with package informationupdating dependencies (including require-Dev)-Installing Predis/predis (v1.1.1) Downloading: -%Predis/predis suggests installing ext-Phpiredis (allows faster serialization and deserialization of the Redis protocol) Writing LockfileGenerating AutoLoad files> PHP Artisan Optimize
You can then use Redis for all kinds of operations in your controller.
Laravel Installing Predis Extensions