rhces 发表于 2018-11-12 10:27:04

yum 6.8 nginx php-fpm

  centos6.8 yum安装 php-fpm
  1.检查当前安装的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源。
  ?
  # 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命令查看版本。
  ?
123456# php --versionPHP 5.6.0 (cli) (built: Sep3 2014 19:51:31)Copyright (c) 1997-2014 The PHP GroupZend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologieswith Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologieswith 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
  安装
  wgethttps://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/-namenginx
  进入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>  查看nginx进程:
  1. ps -ef |grep nginx
  2.ps aux|grep nginx

页: [1]
查看完整版本: yum 6.8 nginx php-fpm