centos6.8 yum安裝 php-fpmphp
1.檢查當前安裝的PHP包
mysql
yum list installed | grep phplinux
若是有安裝的PHP包,先刪除他們
nginx
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 c++
追加CentOS 6.5的epel及remi源。sql
?centos
# rpm -Uvh http:
//ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-
ide
release-6-8.noarch.rpm
php-fpm
# rpm -Uvh http:
//rpms.famillecollet.com/enterprise/remi-release-6.rpm
如下是CentOS 7.0的源。ui
# 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
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
|
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