centos 查询php版本命令,centos 查看系统版本命令

1 lsb_release -a 命令

[root@iz2zehbmmjvren7bs4we3xz /]# lsb_release -a

LSB Version:    :core-4.1-amd64:core-4.1-noarch

Distributor ID:    CentOS

Description:    CentOS Linux release 7.3.1611 (Core)

Release:    7.3.1611

Codename:    Core

2 uname 命令

[root@iz2zehbmmjvren7bs4we3xz /]# uname

Linux

[root@iz2zehbmmjvren7bs4we3xz /]# uname -r

3.10.0-514.26.2.el7.x86_64

3 查看版本文件

[root@iz2zehbmmjvren7bs4we3xz /]# cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

4 rpm命令查看

[root@iz2zehbmmjvren7bs4we3xz /]# rpm -q redhat-release

package redhat-release is not installed

如果上面命令不行可以用下面的

[root@iz2zehbmmjvren7bs4we3xz /]# rpm -q centos-release

centos-release-7-3.1611.el7.centos.x86_64

[root@iz2zehbmmjvren7bs4we3xz /]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS 中更新 PHP 版本命令可以分为两种情况: 1. 通过 Yum 更新 PHP 版本 CentOS 通过 yum 更新 PHP 版本是比较常见的方式,以下是更新至 PHP 7.4 的命令: ``` sudo yum install epel-release sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm sudo yum install yum-utils sudo yum-config-manager --enable remi-php74 sudo yum update sudo yum install php ``` 2. 通过编译源码安装 PHP 如果你想要安装的 PHP 版本不在 CentOS 的 Yum 仓库中可以选择通过编译源码的方式安装,以下是通过编译源码安装 PHP命令: ``` sudo yum install epel-release sudo yum group install "Development Tools" sudo yum install libxml2-devel openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel libicu-devel libmcrypt-devel readline-devel libxslt-devel wget https://www.php.net/distributions/php-7.4.24.tar.bz2 tar -xf php-7.4.24.tar.bz2 cd php-7.4.24 ./configure --prefix=/usr/local/php-7.4.24 --with-config-file-path=/usr/local/php-7.4.24/etc --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mysqli --with-pdo-mysql --with-zlib --with-curl --with-gd --with-jpeg --with-png --with-openssl --with-readline --with-libxml --with-xsl --with-bz2 --with-gettext --with-pear --with-zip --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-mbstring --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-wddx --enable-opcache --enable-zip make sudo make install ``` 以上两种方式都可以更新 PHP 版本,具体选择哪种方式根据自己的需求进行选择。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值