php+nginx+redis安装
2015-07-28 17:56
483 查看
环境:centos
php安装
1 必要的库及工具安装:
2 下载php源码并解压,然后:
3 将php的命令路径加入环境变量中:
4 使用php --version即可看到php的版本信息,到此,php安装完成
nginx安装
参考:http://www.nginx.cn/install
redis安装
到官网下载redis源码
启动redis服务器:redis-server /etc/redis/redis.conf
进入redis命令行客户端:redis-cli
安装php的redis扩展
然后执行php -m | grep redis命令即可看到已加载redis扩展
redis扩展测试:
php安装
1 必要的库及工具安装:
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gd gd2 gd-devel gd2-devel perl-CPAN pcre-devel
2 下载php源码并解压,然后:
cd php-5.5.10/ ./configure --prefix=/usr/local/php --with-config-file-path=/etc/php --enable-fpm --enable-pcntl --enable-mysqlnd --enable-opcache --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --enable-zip --enable-ftp --enable-soap --enable-xml --enable-mbstring --disable-rpath --disable-debug --disable-fileinfo --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pcre-regex --with-iconv --with-zlib --with-mcrypt --with-gd --with-openssl --with-mhash --with-xmlrpc --with-curl --with-imap-ssl sudo make sudo make install sudo cp php.ini-development /etc/php/
3 将php的命令路径加入环境变量中:
vim ~/.bashrc export PATH=/usr/local/php/bin:$PATH export PATH=/usr/local/php/sbin:$PATH source ~/.bashrc
4 使用php --version即可看到php的版本信息,到此,php安装完成
nginx安装
参考:http://www.nginx.cn/install
redis安装
到官网下载redis源码
tar -zxvf redis-xxx.tar.gz cd redis-xxx make make install cp redis.conf /etc/redis/redis.conf
启动redis服务器:redis-server /etc/redis/redis.conf
进入redis命令行客户端:redis-cli
安装php的redis扩展
wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz mv 2.2.4.tar.gz phpredis-2.2.4.tar.gz tar -zxvf phpredis-2.2.4.tar.gz cd phpredis-2.2.4 phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make install向php配置文件加入extension=redis.so
然后执行php -m | grep redis命令即可看到已加载redis扩展
redis扩展测试:
<?php $redis = new Redis(); $redis->connect('127.0.0.1',6379); $redis->set('name','kevin'); echo $redis->get('name');
相关文章推荐
- NoSQL数据库:Redis适用场景及产品定位
- Redis教程4--Redis数据存储优化机制
- Redis教程3--Redis键值设计
- Redis教程2--Redis数据类型及相关命令
- Redis教程1--入门篇
- 图文介绍PHP添加Redis模块及连接
- python操作redis
- redis 快速入门实战
- redis服务启动关闭脚本
- Redis PHP 连接
- redis的安装(windows and linux)
- redis配置认证密码(转)
- 在mac上通过Homebrew安装redis
- redis资料
- Spring Data Redis 键乱码
- 图文介绍PHP添加Redis模块及连接
- Redis介绍和安装
- Redis 的订阅和发布
- Redis使用介绍
- Redis学习笔记---字符串类型