Centos 7.3 搭建php7,mysql5.7,nginx1.10.1,redis
# yum update
# wget http://nginx.org/download/nginx-1.15.2.tar.gz # tar zxvf nginx-1.15.2.tar.gz # cd nginx-1.15.2
./configure --prefix=/usr/local/nginx \ --pid-path=/usr/local/nginx/run/nginx.pid \ --with-http_ssl_module \ --user=nginx \ --group=nginx \ --with-pcre \ --without-mail_pop3_module \ --without-mail_imap_module \ --without-mail_smtp_module
3.安装
# make # make install
make完了就说明安装好了
刚才编译的时候讲nginx编译在了/usr/local/nginx文件夹下,过去启动一下
/usr/local/nginx/sbin/nginx
如果没有任何报错 就说明启动成功了
如果出现了下面代码:
nginx: [emerg] getpwnam("nginx") failed
说明你的服务器上没有nginx用户,新建一个用户和用户组,把nginx放进去了,然后设置不能登录就好了。命令如下:
groupadd nginx useradd -g nginx -M nginx -g为用户指定组 -M不自动生成home目录,毕竟我们只是让系统上有这个帐号,不给登录权限的 vi /etc/passwd 把/bin/bash改为/sbin/nologin 这样nginx就不能登录了
# yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
# yum install mysql-community-server
yum install mysql-community-devel
# service mysqld start Redirecting to /bin/systemctl start mysqld.service
# service mysqld status
# grep 'temporary password' /var/log/mysqld.log # 2016-10-28T02:28:38.449839Z 1 [Note] A temporary password is generated for root@localhost: 8Ba=2gtz+?wx
mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPasdfs4!';
mysql> quit; mysql> mysql -uroot -p
cd /root & wget -O php7.tar.gz http://cn2.php.net/get/php-7.0.30.tar.gz/from/this/mirror
tar -xvf php7.tar.gz
cd php-7.0.1
yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel
# ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-soap --with-libxml-dir --with-xmlrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear --enable-opcache
1.configure: error: xml2-config not found. Please check your libxml2 installation. 解决:# yum install libxml2 libxml2-devel
2.configure: error: Cannot find OpenSSL's <evp.h> 解决:# yum install openssl openssl-devel
3.configure: error: Please reinstall the BZip2 distribution 解决:# yum install bzip2 bzip2-devel
4.configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/ 解决:# yum install libcurl libcurl-devel
5.If configure fails try --with-webp-dir=<DIR> configure: error: jpeglib.h not found. 解决:# yum install libjpeg libjpeg-devel
6.If configure fails try --with-webp-dir=<DIR> checking for jpeg_read_header in -ljpeg... yes configure: error: png.h not found. 解决:# yum install libpng libpng-devel
7.If configure fails try --with-webp-dir=<DIR> checking for jpeg_read_header in -ljpeg... yes checking for png_write_image in -lpng... yes If configure fails try --with-xpm-dir=<DIR> configure: error: freetype-config not found. 解决:# yum install freetype freetype-devel
8.configure: error: Unable to locate gmp.h 解决:# yum install gmp gmp-devel
9.configure: error: mcrypt.h not found. Please reinstall libmcrypt.解决:# yum install libmcrypt libmcrypt-devel如果出现 No package libmcrypt available. No package libmcrypt-devel available.执行:#yum install libmcrypt libmcrypt-devel mcrypt mhash epel-release然后再安装:#yum install libmcrypt libmcrypt-devel
10.configure: error: Please reinstall readline - I cannot find readline.h 解决:# yum install readline readline-devel
11.configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution 解决:# yum install libxslt libxslt-devel
make && make install
vim /etc/profile
PATH=$PATH:/usr/local/php/bin export PATH
# source /etc/profile
# echo $PATH
# php -v
# cp php.ini-production /etc/php.ini # cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf # cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf # cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm # chmod +x /etc/init.d/php-fpm
/etc/init.d/php-fpm start
location ~ \.php$ {root html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;include fastcgi_params;}
service nginx reload
vim /var/www/html/php7/index.php
<?php phpinfo(); ?>
sudo yum install gcc-c++
wget http://download.redis.io/releases/redis-3.2.8.tar.gz
tar -zxvf redis-3.2.8.tar.gz
cd redis-3.2.8
make MALLOC=libc
make install // make test
./redis-server
you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
echo never > /sys/kernel/mm/transparent_hugepage/enabled
mkdir -p /etc/redis cp redis.conf /etc/redis
/usr/local/bin/redis-server /etc/redis/redis.conf
ps -ef | grep redis
redis-cli
转载于:https://www.cnblogs.com/pfdltutu/p/9020296.html
Centos 7.3 搭建php7,mysql5.7,nginx1.10.1,redis相关推荐
- ubuntu php 支持mysql_在ubuntu16.04上安装php7 mysql5.7 nginx1.10并支持http2
安装nginx 首先更新软件包 并且安装nginx sudo apt-get update sudo apt-get install nginx 开放防火墙配置 sudo ufw allow 'Ngi ...
- lnmp环境搭建 php7,lnmp环境搭建(centos6.9+mysql5.7+php7.1+nginx1.10)
安装前准备:CentOS 6.9 64位 最小化安装 yum install -y make gcc gcc-c++ perl zlib-devel libaio libpng libpng-deve ...
- LNMP环境搭建(centos6.9+mysql5.7+php7.1+nginx1.10)
一.安装MySql (本文永久地址:http://woymk.blog.51cto.com/10000269/1917133) mysql的安装请参考 LAMP环境搭建(centos6.9+apach ...
- Centos搭建PHP5.3.8+Nginx1.0.9+Mysql5.5.17
Centos搭建PHP5.3.8+Nginx1.0.9+Mysql5.5.17 操作环境 操作系统:Mac Os Loin 虚拟主机:VMware Fusion 虚拟系统:Centos 5.5+ 操作 ...
- centos php7.0 mysql_CentOS 7.3 下 安装LNMP(Nginx1.10+MySQL5.7+PHP7.0.20)
前言:最近总是要安装服务器环境,记录这次CentOS 7.3下安装LNMP(Nginx1.10+MySQL5.7+PHP7.0.20)环境的过程,以备日后使用. 一.准备工作 1. 更新源 # yum ...
- 搭建LNMP环境(CentOS 6.8 + nginx1.10 + mysql5.6 + php5.6 )
安装nginx 1.添加运行nginx服务进程的用户 # groupadd -r nginx # useradd -r -g nginx nginx 2.下载源码包解压编译. # cd /usr/lo ...
- php5.3 php7兼容,Centos搭建PHP7.0.x让php5.3和php7兼容共存教程
先安装php5.3 就不说,说Centos搭建PHP7.0教程: # wget http://php.net/get/php-7.0.4.tar.gz/from/a/mirror 解压安装 # ta ...
- centos 6.5 搭建lnmp环境
centos 6.5 搭建lnmp环境 建议安装顺序: mysql------->>编译php---->>编译nginx 最麻烦:编译php出各种错. 最简单:mysql 软件 ...
- php5.3 with-mysql centos_Centos编译搭建php7让php5.3和php7兼容共存教程
PHP7版本现在在linux系统中已经开始使用起来了,下面我们来看一篇关于Centos搭建PHP7.0.x让php5.3和php7兼容共存教程,希望下文对各位有帮助. 先安装php5.3 就不说,说C ...
最新文章
- jQuery选择器实现隔行变色和使用javaScript实现隔行变色
- 03-----数据类型
- HDU - 6704 K-th occurrence (后缀数组+主席树)
- html怎么设置数据条的颜色,jQuery EasyUI 数据网格 – 条件设置行背景颜色 | 菜鸟教程...
- 解决IDL检索COM类工厂中CLSID为{ }组件注册失败
- 网上常用免费WebServices集合
- OSChina 周五乱弹 ——发现办公室女同事走光了
- Python中pip版本升级error:You are using pip version 7.1.2, however version 8.1.1 is available.
- 【Linux】scp IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
- hibernate 中的一级缓存 二级缓存
- eclipse缺少org.apache.http.legacy的解决办法
- 通过vba代码将excel转换为PDF
- CodeBlock13.12对gcc与g++的更新
- rest-assured一些使用心得
- Python+Kivy(App开发)从入门到实践
- 模拟电子_安规X电容和Y电容的区别与作用
- ubuntu16.04录制4K屏软件使用备注
- 图像语义分割入门:FCN/U-Net网络解析
- MongodDB集群设置登录账号密码(增加key-file以供集群内部相互验证身份)
- 关于负数在计算机中的表示方法
热门文章
- 海洋工作室——网站建设专家:全数据库比较工具
- Element-UI + Vue.js + SpringBoot 实现前后端分离入门项目
- Navicat12及以上才能显示json数据
- IE选项中的高级选项卡“启用内存保护帮助减少联机攻击”是灰色的,不能把前面的勾选取消掉
- js休眠实现sleep[博]
- 帮你找到了几份非公开的大数据报告,错过再无,手慢的人抓紧
- 分布式模块之间的调用_分布式事务
- 在matlab环境中实现图像的傅里叶变换,matlab用傅里叶变换实现图像的低通滤波
- 计算机网络 故障处理,计算机网络通讯技术故障分析与处理
- python中reshape_python numpy reshape用法及代码示例