centos6安装PHP5.4

时间:2022-09-04 07:21:08
centos6安装PHP5.4

安装的命令行很简单

sudo yum --enablerepo=remi install php

不过如果你没有配置源Repository,就需要首先启动REMI源:

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#64Bit下载
wget http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
#32Bit下载
wget http://mirrors.sohu.com/fedora-epel/6/i386/epel-release-6-8.noarch.rpm

rpm安装

rpm -Uvh epel-release--.noarch.rpm
rpm -Uvh remi-release-.rpm

然后用remi源来安装php

 
yum --enablerepo=remi install php

确认正确的版本,回答Y开始安装。

如何查看PHP的版本号:

# php -v

PHP 5.4. (cli) (built: Jun   ::)
Copyright (c) - The PHP Group
Zend Engine v2.4.0, Copyright (c) - Zend Technologies
with Zend Guard Loader v3., Copyright (c) -, by Zend Technologies
安装成功。