首頁  >  文章  >  後端開發  >  如何安裝php的redis擴展

如何安裝php的redis擴展

WJ
WJ原創
2020-06-01 11:06:303367瀏覽

如何安裝php的redis擴展

php安裝php的redis擴充功能的方法:

1. 安裝redis

  Redis安裝流程請移步 https ://www.cnblogs.com/IT-Crowd/articles/10626765.html

2. 下載Redis擴充

 [root@root php-extension]# wget https://pecl.php.net/get/redis-4.3.0.tgz

3. 解壓縮tar -zxvf redis-4.3.0.tgz

[root@root php-extension]# tar -zxvf redis-4.3.0.tgz

4. 產生configure設定檔

 [root@root php-extension]# cd redis-4.3.0
 [root@root redis-4.3.0]# /usr/local/php/bin/phpize

5.安裝redis擴充功能

  [root@root redis-4.3.0]# ./configure --with-php-config=/usr/local/php/bin/php-config
 [root@root redis-4.3.0]# make && make install

  安裝完成提示:

#    Build complete.

#    Build complete.

#    Build complete.

#    Build complete.

#    Build. Don't forget to run 'make test'.

    Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/

6.在php.ini中加入Redis擴充

  先設定extension_dir:

extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/"
如何安裝php的redis擴展  在extension_dir下方新增 extension = redis.so7.重啟PHP##P
 [root@root redis-4.3.0]# service php-fpm restart
8.Redis擴充安裝成功

#######相關參考:######php中文網#########

以上是如何安裝php的redis擴展的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn