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/"在extension_dir下方新增 extension = redis.so7.重啟PHP##P
[root@root redis-4.3.0]# service php-fpm restart8.Redis擴充安裝成功#######相關參考:######php中文網#########
以上是如何安裝php的redis擴展的詳細內容。更多資訊請關注PHP中文網其他相關文章!