1.安装php7.0
下载
# wget http://cn2.php.net/distributions/php-7.0.4.tar.gz
如果配置错误,需要安装需要的模块,直接yum一并安装依赖库
# yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel mysql pcre-devel
#需要安装libmemcached最新版本(所需组件)
wget https:
//launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar -zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure --prefix=/usr/local/libmemcached
#安装memcached扩展
git
clone
https:
//github.com/php-memcached-dev/php-memcached -b php7
cd php-memcached
查看nginx相关信息
yum list | grep nginx
collectd-nginx.x86_64 4.10.9-1.el6 epel
munin-nginx.noarch 2.0.25-2.el6 epel
nginx.x86_64 1.0.15-11.el6 epel
nginx-filesystem.noarch 1.0.15-11.el6 epel
owncloud-nginx.noarch 7.0.5-2.el6 epel
yum info nginx
Loaded plugins: security
Available Packages
Name : nginx
Arch : x86_64
Version : 1.0.15
Release : 11.el6
Size : 404 k
Repo : epel
Summary : A high performance web server and reverse proxy server
URL : http://nginx.org/
License : BSD
Description : Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and
: IMAP protocols, with a strong focus on high concurrency, performance and
: low memory usage.
发现版本很低,于是追加 nginx 的 yum 仓库,创建一个文件 /etc/yum.repos.d/nginx.repo,并将下面的内容复制进去
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
编辑并保存/etc/yum.repos.d/nginx.repo文件后,在命令行下执行
yum list | grep nginx
collectd-nginx.x86_64 4.10.9-1.el6 epel
munin-nginx.noarch 2.0.25-2.el6 epel
nginx.x86_64 1.6.3-1.el6.ngx nginx
nginx-debug.x86_64 1.6.3-1.el6.ngx nginx
nginx-debuginfo.x86_64 1.6.3-1.el6.ngx nginx
nginx-filesystem.noarch 1.0.15-11.el6 epel
nginx-nr-agent.noarch 2.0.0-7.el6.ngx nginx
owncloud-nginx.noarch 7.0.5-2.el6 epel
发现最新的稳定版1.6.3,于是直接执行
yum install nginx -y
安装完成,下面直接就可以启动Nginx了:
/etc/init.d/nginx start
Starting nginx: [ OK ]
现在Nginx已经启动了,直接访问服务器就能看到Nginx欢迎页面了的。
Nginx的命令以及配置文件位置:
/etc/init.d/nginx start # 启动Nginx服务
/etc/init.d/nginx stop # 停止Nginx服务
/etc/nginx/nginx.conf # Nginx配置文件位置
关闭php
killall php-fpm
php重启
/usr/local/php/sbin/php-fpm &
关闭nginx
/usr/sbin/nginx -s stop //关闭服务器
重启nginx
/usr/sbin/nginx 开启服务器