yum search php7,Centos 7 yum 安装 php7 nginx

cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

Install PHP7

1 添加源

yum -y install epel-release

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

2 安装php7

添加源后,更新一下,yum updateinfo,然后yum search php7 看下源里PHP7存在哪些小版本:

...

mod_php71w.x86_64 : PHP module for the Apache HTTP Server

php71w-bcmath.x86_64 : A module for PHP applications for using the bcmath

php71w-cli.x86_64 : Command-line interface for PHP

php71w-common.x86_64 : Common files for PHP

php71w-dba.x86_64 : A database abstraction layer module for PHP applications

php71w-devel.x86_64 : Files needed for building PHP extensions

php71w-embedded.x86_64 : PHP library for embedding in applications

php71w-enchant.x86_64 : Enchant spelling extension for PHP applications

...

看样子已经到PHP7.1了,那就体验下最新的特性,使用命令yum install mod_php71w php71w-cli php71w-devel php71w-mysql安装,如果没有MySQL需求,可以去掉php71w-mydql. 安装成功后,php -v查看版本信息:

PHP 7.1.5 (cli) (built: May 12 2017 21:54:58) ( NTS )

Copyright (c) 1997-2017 The PHP Group

Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

Install Nginx

安装nginx也比较简单,根据官网指导教程就可以完成。 我安装的是稳定版。 vi /etc/yum.repos.d/nginx.repo

[nginx]

name=nginx repo

baseurl=http://nginx.org/packages/centos/7/$basearch/

gpgcheck=0

enabled=1

然后yum search nginx查看版本,选择需要的版本,我选了默认的版本,并安装了扩展:yum install nginx nginx-all-modules. 安装完毕,nginx -V查看Nginx的版本和路径参数及扩展支持:

nginx version: nginx/1.12.0

built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)

built with OpenSSL 1.0.1e-fips 11 Feb 2013

TLS SNI support enabled

configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值