yum 6.8 nginx php-fpm

简介: centos6.8 yum安装 php-fpm1.检查当前安装的PHP包yum list installed | grep php如果有安装的PHP包,先删除他们yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64  配置yum源追加CentOS 6.5的epel及remi源。

centos6.8 yum安装 php-fpm

1.检查当前安装的PHP包

yum list installed | grep php


如果有安装的PHP包,先删除他们

  1. yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64  



配置yum源

追加CentOS 6.5的epel及remi源。

?

# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-

release-6-8.noarch.rpm

# rpm -Uvh http: //rpms.famillecollet.com/enterprise/remi-release-6.rpm



以下是CentOS 7.0的源。

?

# yum install epel-release
# rpm -ivh http: //rpms.famillecollet.com/enterprise/remi-release-7.rpm



使用yum list命令查看可安装的包(Packege)。

?# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php


安装PHP5.6.x

yum源配置好了,下一步就安装PHP5.6。

?

# yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache 

php-devel php-mbstring php-mcrypt php-mysqlnd 

php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof


PHP命令查看版本。

?

1
2
3
4
5
6
# php --version
PHP 5.6.0 (cli) (built: Sep  3 2014 19:51:31) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derck Rethans



安装PHP-fpm

yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm 



centos6.8 安装nginx



准备条件

yum install -y gcc-c++

yum install -y pcre pcre-devel

yum install -y zlib zlib-devel

yum install -y openssl openssl-devel

安装

wget  https://nginx.org/download/nginx-1.8.0.tar.gz

tar zxvf nginx-1.8.0.tar.gz

cd nginx-1.8.0

./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module

--with-pcre

make && make install


查看服务路径

find/  -name  nginx

进入nginx安装路径:cd /usr/local/nginx/sbin

启动服务

启动:

1. ./nginx

2. /usr/local/nginx/sbin/nginx

-c /usr/local/nginx/conf/nginx.conf

两种方式都可以

4. 停止:

从容停止:kill -QUIT 19795(注意:19795是Nginx的进程号)

快速停止:kill -TERM 46968(注意:46968是Nginx的进程号)

(强制停止:pkill -9 nginx

./nginx -s stop:此方式相当于先查出nginx进程id再使用kill命令强制杀掉进程。

./nginx -s quit:此方式停止步骤是待nginx进程处理任务完毕进行停止。 

先停止再启动:./nginx -s quit; ./nginx)

.验证nginx的配置文件是否正确:

1. cd /usr/local/nginx/sbin 进入nginx的安装目录,接着执行 ./nginx -t

重新加载配置文件:

./nginx -s reload

查看nginx进程:

1. ps -ef |grep nginx

2.ps aux|grep nginx



目录
相关文章
|
2月前
|
Linux 应用服务中间件 网络安全
CentOS7搭建本地离线局域网yum源(Httpd/Nginx+yum)
CentOS7搭建本地离线局域网yum源(Httpd/Nginx+yum)
781 0
|
应用服务中间件 nginx
Centos7.3 卸载 Nginx(彻底卸载) 并重新安装 Nginx(RPM源yum安装)
Centos7.3 卸载 Nginx(彻底卸载) 并重新安装 Nginx(RPM源yum安装)
920 0
Centos7.3 卸载 Nginx(彻底卸载) 并重新安装 Nginx(RPM源yum安装)
|
1天前
|
应用服务中间件 nginx
Ngnix07---通过yum安装Ngnix下 whereis ngnix可以查看Ngnix相关的一些目录,使用./nginx -y可以查看Ngnix版本及相关配置信息,使用 more CHANGES
Ngnix07---通过yum安装Ngnix下 whereis ngnix可以查看Ngnix相关的一些目录,使用./nginx -y可以查看Ngnix版本及相关配置信息,使用 more CHANGES
|
1天前
|
应用服务中间件 开发工具 nginx
Ngnix09目录结构分析,使用tree工具可以Ngnix目录中以一个树的方式呈现出来,yum install -y tree,tail -f nginx/logs/access.log
Ngnix09目录结构分析,使用tree工具可以Ngnix目录中以一个树的方式呈现出来,yum install -y tree,tail -f nginx/logs/access.log
|
1月前
|
Linux 应用服务中间件 开发工具
centos linux 通过yum安装nginx
centos linux 通过yum安装nginx
130 0
|
2月前
|
应用服务中间件 nginx
yum 安装报错 No package nginx available Error:Nothing to do
yum 安装报错 No package nginx available Error:Nothing to do
92 1
QGS
|
应用服务中间件 PHP nginx
(openEuler21.03-Centos7-x86)yum安装php+nginx—配置nginx解析php
记(openEuler21.03-Centos7-x86)yum安装php+nginx—配置nginx解析php
QGS
738 0
(openEuler21.03-Centos7-x86)yum安装php+nginx—配置nginx解析php
QGS
|
应用服务中间件 nginx
Centos7yum安装nginx,处理端口占用报错
记Centos7yum安装nginx,处理端口占用报错
QGS
313 0
Centos7yum安装nginx,处理端口占用报错
QGS
|
应用服务中间件 Shell 网络安全
Centos7-x86 yum安装配置nginx解析php—shell脚本
记Centos7-x86 yum安装配置nginx解析php—shell脚本
QGS
215 0
Centos7-x86 yum安装配置nginx解析php—shell脚本
|
Linux 应用服务中间件 nginx
centos7 centos yum 源安装 nginx | centos7.3
centos7 centos yum 源安装 nginx | centos7.3 | centos 7.2 | centos 7.4
centos7 centos yum 源安装 nginx | centos7.3