centos 7安装redis及php-redis扩展

Centos7+php7.4安装redis5,配置redis扩展 安装完成后进入/usr/local/redis/bin目录,会有redis服务程序redis-server和redis测试程序redis-cli。这种启动方式适用的是默认配置,就和在window下启动一样,关掉窗口redis服务就会关闭,所以我们需要配置redis在后台运行。从 redis 的源码目录中复制 redis.conf 到 redis 的安装目录。----查找php-config的位置。----查看redis.so是否存在。----寻找php.ini所在到目录。----查看php.ini的内容。 阅读详情

首先,下载安装redis服务端+客户端

下载,解压,编译:

$ wget http://download.redis.io/releases/redis-3.2.9.tar.gz
$ tar xzf redis-3.2.9.tar.gz
$ cd redis-3.2.9$ make

#二进制文件是编译完成后在src目录下,通过下面的命令启动Redis服务:

$ src/redis-server
#你可以使用内置的客户端命令redis-cli进行使用:

$ src/redis-cli
redis> set foo bar
    OK
redis> get foo"bar"

下载安装php-redis扩展: 地址:https://github.com/phpredis/phpredis/

$ wget http://pecl.php.net/get/redis-3.1.2.tgz
$ tar xzf redis-3.1.2.tgz 
$ cd redis-3.1.2/
$ phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config
#这里的php-config路径 根据自己实际情况而定
$  make && make install

#出现
#Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
#即为安装成功。
#打开php.in文件,并添加 extension=redis.so,保存退出即可
$ vim /usr/local/php/etc/php.ini
  #文件末尾添加 extension=redis.so
  #保存退出,

重启php+nginx服务,phpinfo中将会出现redis扩展信息

测试:

启动redis服务,

$ cd redis-3.1.2
$ src/redis-server

编辑test.php测试文件

<?php
$redis = new Redis();

$redis->connect('127.0.0.1', 6379);

$redis->set("name", "nango");
echo $redis->get('name');
?>

原文出处:5none -> http://blog.5none.com/index/show/index/cid/10/id/27.html

LINUX(CentOS 7) php7.4安装redis以及php-redis扩展 CentOS 7下PHP7.3安装redis扩展1.安装phpize2.下载、解压、编译Redis3.解压php7.zip总结 1.安装phpize yum -y install php73-php-devel 2.下载、解压、编译Redis cd /usr/local/src wget http://download.redis.io/releases/redis-4.0.6.tar.gz tar -zxvf redis-4.0.6.tar.gz cd redis-4.0.6 ./configure - 阅读详情

相关推荐

CentOS 7 安装 Redis 和 PHP Redis 扩展教程

Redis 是一个开源的内存数据结构存储系统,它提供了高性能和可扩展性,被广泛应用于缓存、队列和实时分析等场景。PHP Redis 扩展是与 Redis 服务器进行交互的 PHP 扩展模块,它提供了方便的 API,使开发人员可以轻松地在 PHP 应用程序中使用 Redis。本教程将为您提供在 CentOS 7 服务器上安装 Redis 和 PHP Redis 扩展的详细步骤。

DqClojure的博客 993

centos7 php安装redis以及redis扩展

安装Redis Redis官方下载地址:http://redis.io/download,下载最新稳定版本。 当前稳定版本是4.0.9,下载并安装: 安装之前请 安装软件的时候,提示make: command not found Centos中无法使用make,make install,命令 make: command not found make是gcc的编译器,VPS买来必定要安装 ...

qq_42572322的博客 810

从IMU数据到精准定位:手把手推导ESKF中的四元数运动学与误差状态方程

本文详细介绍了如何从IMU数据推导ESKF中的四元数运动学与误差状态方程,实现精准定位。通过分析误差状态卡尔曼滤波器的优势、四元数表示的必要性,以及IMU测量模型和运动学基础,提供了完整的数学推导和实现要点。适合机器人定位和自动驾驶领域的算法工程师参考,帮助优化导航系统性能。

weixin_30271335的博客 680

CentOS 7环境安装Redis和相应的php扩展

安装Redis服务 下载资源并执行安装 mkdir /home/download &amp;&amp; cd /home/download #下载到任何地方都可以 wget http://download.redis.io/releases/redis-4.0.6.tar.gz #当前最新版本有5.0可到官网下载 tar xzf redis-4.0.6.tar.gz cd redis-4.0....

YZJ0517的博客 320

【微知】关于GB200 NVL72服务器的一些信息?(36CPU72GPU;LPDDR5X 17T;HBM3e 13.5T;5代NVlink 1.8TB; 720P算力FP8;120Kw)

本文仅根据官网介绍分析,存在纰漏仅供参考。

技术札记 5391

python调用海康工业相机并用opencv显示(整体实现)

python语言调用海康机器人(hikrobotics)工业相机 第一章 Python 语言下连接海康工业相机,并获取数据 文章目录 系列文章目录 前言 目录 python语言调用海康机器人(hikrobotics)工业相机 文章目录 前言 一、底层接口的准备 二、使用步骤 1.引入库 2.枚举设备 3.判断设备类型 4.输入连接设备 5.创建相机实例并创建句柄 6.打开设备 7.获取相关参数 8.主动获取图像 9.开启取流并获取每张.

qq_39570716的博客 5万+

centos7 安装redis服务及phpredis扩展

闲话少说 服务器版本:centos7.6 64位 软件包:https://pan.baidu.com/s/1Gb4iz5mqLqNVWvvZdBiOMQ提取码: xrhx 一、安装redis 放在/usr/local/src文件夹下 tar -zxvf redis-4.0.8.tar.gzcd redis-4.0.8make MALLOC=libc 将/usr/loc...

weixin_33819479的博客 213

C#操作SQLite数据库帮助类——SQLiteHelper

using System; using System.Collections.Generic; using System.Data.SQLite; using System.Data; namespace Com.ZCWL.Rock.Helper { public class SQLiteHelper { private static string connectionString =

跟健哥出去走走 2万+

centos7.9&php8&swoole5&swoft2环境安装遇到确实redis扩展的解决办法

本次在centos7.9服务器上安装的php8、swoole5、swoft2环境中,启动swoft2服务的时候出现加载redis扩展失败的问题以及解决方法

weixin_43672348的博客 835

28377D Bootloader

架构

a6100309120的博客 6013

RK3568笔记十七:LVGL v8.2移植

若该文为原创文章,转载请注明原文出处。本文介绍嵌入式图形库移植到Linux开发板ATK-RK3568上的步骤。

4232

centos7 编译安装php8 以及redis、mongo扩展

centos7 编译安装php8 以及redis、mongo扩展

weixin_45943724的博客 1426

《QGIS快速入门与应用基础》010:下载过程中常见问题(如网速慢、文件损坏)

针对QGIS下载过程中的常见问题提供了系统解决方案。主要解决下载速度慢(≤100KB/s)和文件损坏两大核心问题:通过切换国内镜像源(如清华大学、阿里云)、使用专业下载工具提升速度;采用MD5/SHA256校验确保文件完整性,并排查存储介质和杀毒软件干扰。文章还包含macOS权限问题、Linux依赖缺失等高频问题的速解方案,并附详细的排查流程图和预防技巧,帮助用户顺利完成QGIS下载。后续将详细介绍安装流程,适合零基础用户参考。

LuckyHanMo的博客 482

centos7 php7安装redis扩展

环境 linux centos7 php7.1 一、下载安装包 下载地址: http://pecl.php.net/package/redis [root@localhost ~]# wget -c http://pecl.php.net/get/redis-4.2.0.tgz 二、解压安装包 [root@localhost ~]# tar -zvxf redis-4.2.0.tgz ...

Cywanp的博客 3388

走向审计4.0:内部审计数字化转型的路径与方法

企业的内部审计人员可以以数字化为手段,建立内部审计新生态,在数字化过程中引进战略审计、服务审计、开放审计、敏捷审计、数字审计、智慧审计等理念、方法和工具,完成数智生态审计转型。内部审计的审计对象远比国家审计和公众审计丰富和多元化,理论上企业经营管理和日常操作的各个方面都可以成为内部审计的对象,此外还可以开展独立咨询活动。由于内部审计的数字化或数字化的内部审计是实现审计数字化转型的必要条件,是实现“数字引领、数据强审”目标的核心手段,因此企业内部审计部门势必要投入足够的资金和人才来打造一支数字化审计新队伍。

一键难忘的博客 6737

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

CentOS7 Yum安装Redis5以及PHP的Redis扩展

重新整理了一下安装redis5.0.4以及PHP的redis扩展过程。 #1 相关信息说明 阿里云服务器CentOS7 已安装LNMP环境 安装的Redis版本为5.0.4 #2 查看当前可安装的Redis版本 yum update ##先将各个源的RPM包列表进行更新 yum list | grep redis 我安装时官网最新的稳定版本为5.0.5,但此时系统中最新的稳定版...

MYXuu的博客 7561

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

centos7下php安装Redis扩展

1.说明系统版本:CentOS7 php版本:5.6 php安装目录:/usr/local/php php.ini配置文件路径:/usr/local/php/etc/php.ini Nginx安装目录:/usr/local/nginx Nginx网站根目录:/usr/local/nginx/html2.准备依赖包yum install wget make gcc gcc-c++ zlib

朦胧的旋律 1809

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

CentOS7安装配置Redis及PHP扩展

CentOS7安装配置Redis及PHP扩展 一、相关环境: 1、Linux环境: # cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core) 2、PHP环境: #php -v PHP5.4 3、依赖环境gcc gcc -v 二、安装Redis: 进入root目录执行如下命令: wget http://download.redis.io/releases/redis-5.0.5.tar.gz tar -zxvf redis-5.0.5.

weixin_45664706的博客 280

Centos7安装php-redis扩展

Centos7安装php-redis扩展 前言: 在本篇博客中,我将给大家介绍如何在Centos7上安装PHP-redis扩展以及一些简单的实用,关于如何在Centos上安装redis的,可以参考我的上一篇博客 Redis在Centos7上的安装部署 想要在php中操作redis,那就必须安装php-redis扩展,就比如MySQL一样,php想要操作mysql数据库的话,就必须安装mysql扩展...

root_miss的博客 326

liunx php redis扩展,CentOS 7下安装php-redis扩展及简单使用

前言:在本篇文章中,我将给大家介绍如何在CentOS7上安装PHP-Redis扩展以及一些简单的实用,关于如何在Centos上安装redis的,可以参考想要在php中操作redis,那就必须安装php-redis扩展,就比如MySQL一样,php想要操作mysql数据库的话,就必须安装mysql扩展,只是在php安装中就默认安装了mysql扩展了。步骤一:下载解压下载:https://github...

weixin_29644109的博客 177

CentOS7 安装Redis和PHP-redis扩展

https://www.cnblogs.com/haozhen/p/9851712.html Redis是一个key-value存储系统,属于我们常说的NoSQL。它遵守BSD协议、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。它常用在缓存、队列、Pub/Sub、计数统计、排行榜、投票与排序等场景。 本文介绍如何在CentOS7上安装redis,以及...

qq_42572322的博客 254

linux centos7 lnmp 安装redis及php开启redis扩展 自测

linux centos7 lnmp 安装redis及php开启redis扩展 自测 php7安装Redis扩展 同样的,Redis其实也已经有了 PHP 7 版本,我们从 github 上获取项目克隆,然后手动切换到 php7 分支即可: git clone -b php7_ipv6 https://github.com/phpredis/phpredis.git cd /usr/loca...

niefudong的博客 277

centos php.ini redis,CentOS7安装Redis和PHP-redis扩展

本文介绍如何在CentOS7上安装redis,以及让PHP支持redis的php-redis扩展库。安装Redis当前稳定版本是4.0.9,下载并安装:$ wget http://download.redis.io/releases/redis-4.0.9.tar.gz$ tar -zxvf redis-4.0.9.tar.gz$ mv redis-4.0.9 /usr/local/redis$ ...

weixin_36328210的博客 218

CentOS 7 安装PHP7.3.2 - 编译安装(并安装redis扩展)

1 安装扩展包并更新系统内核 yum install epel-release -y yum update 2 YUM安装PHP依赖组件(包含Nginx依赖): yum -y install php-mcrypt libmcrypt-devel libxml2 libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel l...

打卤的博客 4926

CentOS 7 & php7.2安装 php-redis 扩展

CentOS 7 & php7.2安装 php-redis 扩展1、下载phpredis-developcd /tmpwget https://codeload.github.com/phpredis/phpredis/zip/develop1.1、如果系统未安装zip包,则安装unzip、zip解压工具yum -y install unzip zip2、解压phpredis-develo...

weixin_30516243的博客 195
上一篇: CentOS LAMP运行环境安装
下一篇: Git问题解决:warning: Pulling without specifying how to reconcile divergent branches is discouraged. You
Pleidy
博客等级 码龄6年 0粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值