How to install the PHP redis extension in the Homestead PHP7 Ubuntu Environment

Source: Internet
Author: User
Tags php redis
Reprint: HTTPS://LARACASTS.COM/DISCUSS/CHANNELS/TIPS/TUTORIAL-GUIDE-INSTALLING-PHP-REDIS-ON-FRESH-INSTALL-HOMESTEAD-WITH-PHP7

vagrant@homestead:~$ sudo apt-get updatevagrant@homestead:~$ git clone-b php7 https://github.com/phpredis/ phpredis.gitvagrant@homestead:~$ sudo mv phpredis//etc/vagrant@homestead:~$ cd/etc/phpredisvagrant@homestead:/etc/ phpredis$ phpizevagrant@homestead:/etc/phpredis$./configurevagrant@homestead:/etc/phpredis$ make && make Installnote This is a Extension you need to Enable the IT work in PHP 7This first Command would allow your to call PHP REDIS facade in browservagrant@homestead:/etc/phpredis$ sudo vim/etc/php/7.0/fpm/conf.d/redis.iniinside vim Paste     thisextension=/etc/phpredis/modules/redis.so:w! ->write/save:q->exit Vimnote This Extension needs to being enable in PHP INI to enable it on your Command line Interf Ace Such as artisan.the usual problem you'll face If you Wont does this are Get a Redis Class not foundvagrant@homestead:/e tc/phpredis$ sudo vim/etc/php/7.0/cli/php.inithen look for this Word CLI servertype/cli Server Add to the last line of ex Tensionextension=/etc/phpredis/modules/redis.so:w! ->write/save:q->exit vimvagrant@homestead:/etc/phpredis$ sudo service php7.0-fpm restartvagrant@homestead:/ etc/phpredis$ sudo service nginx restartto Test if Phpredis Extension is Workingphp-r "if (new Redis () = = true) {echo \" \ r\n OK \r\n\ ";  } "It should Return ok!
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.