centos7 yum快速安装php7.1

摘要:
-e$request_filename){rewrite^/(.*)$/index.php/$1last;}try_files$uri$uri//index.php?

1. 安装nginx

yum install nginx
##开启nginx
service nginx start

2.安装MYSQL
yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

yum install mysql-community-server

//开启mysql
service mysqld start

//查看mysql的root账号的密码
grep 'temporary password' /var/log/mysqld.log

//登录mysql
mysql -uroot -p

//修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

//修改root用户可远程登录
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

//刷新
flush privileges;

3.安装php
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

//查看
yum search php71w

//安装php以及扩展
yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath

//开启服务
service php-fpm start

//修改/etc/nginx/nginx.conf 使其支持php 见下
//重启nginx
service nginx restart
---------------------配置

server {
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen foripv4
server_name localhost;
root /var/www/;
index index.php;
location /{
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1last;
}
try_files $uri $uri/ /index.php?$args;
}
location ~.php$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
try_files $uri =404;
}
location ~.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/fastcgi_params;
fastcgi_split_path_info ^(.+.php)(/?.*)$;
fastcgi_param SCRIPT_FILENAME
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
error_page 404 /404.html;
location ~ /.(ht|svn|git) {
deny all;
}
}

4.安装redis

yum install redis
//修改配置 
vi /etc/redis.conf
//daemonize yes 后台运行
//appendonly yes 数据持久化
service redis start

5.安装php-redis扩展
//先装git
yum install git

//git下扩展
cd /usr/local/src
git clone https://github.com/phpredis/phpredis.git

//安装扩展
cd phpredis
phpize

//修改php配置
vi /etc/php.ini 添加extension=redis.so

//重启php
service php-fpm restart

免责声明:文章转载自《centos7 yum快速安装php7.1》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇字典(dict),增删改查,嵌套AtCoder Regular Contest 100 (ARC100) E下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Spring Cache的基本使用与分析

概述 使用 Spring Cache 可以极大的简化我们对数据的缓存,并且它封装了多种缓存,本文基于 redis 来说明。 基本使用 1、所需依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spr...

腾讯云ubuntu18.04启用root用户

需求场景 腾讯开通的ubuntu主机,默认用户是ubuntu,并且这个ubuntu的权限还是相对比较低的,虽然提升了安全性,可是对于个人站长来说方便才是硬道理,自己也不会用root用户瞎操作。这个时候就需要用权限更大的root用户登录操作了。 步骤一:设置root密码 sudo passwd root回车设置两次密码即可 步骤二:修改ssh登录的配置 很多...

Redis操作命令大全(NodeJS版)

/*—————————————————————————————— * 本文案例基于以下运行环境: * 系统: CentOS 5.x * NodeJS版本: 0.9 以上 * Redis版本: 2.8 * Redis-nodejs 扩展: 0.12.1  /*—————————————————————————————— Part 1: 安装扩展 使用以下命令...

使用SpringSession和Redis解决分布式Session共享问题

SpringSession优势 遵循servlet规范,同样方式获取session,对应用代码无侵入且对于developers透明化 关键点在于做到透明和兼容 接口适配:仍然使用HttpServletRequest获取session,获取到的session仍然是HttpSession类型——适配器模式 类型包装增强:Session不能存储在web容器内...

window安装redis无法启动报错

windows下安装Redis第一次启动报错: Creating Server TCP listening socket 127.0.0.1:6379: bind: No error 解决方法:在命令行中运行 1 在服务里, 将redis停掉重启就行 2 可以具体进行如下操作 redis-cli.exe 127.0.0.1:6379>shutdown...

redis集群搭建及一些问题

redis 1、简化版redis (本套Redis集群为简化版安装部署,只需解压至普通用户家目录下或者任意目录,解压后修改脚本,执行脚本后即可使用。) 注意,此版本需要在redis配置文件中添加 protected-mode no,确认添加完成后再启动服务。 1、单机部署 1.新建普通用户,将压缩包解压到家目录下。 tar zxf rediscluste...