这里有新鲜出炉的PHP设计模式,程序狗速度看过来!
PHP(外文名: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,入门门槛较低,易于学习,使用广泛,主要适用于web开发领域。PHP的文件后缀名为php。
本篇文章主要介绍了Centos下YUM安装PHP的两种方式,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
在Centos下安装PHP时, 先后使用了两种方式进行实现, 现整理出来以作记录。
摘要
一般Centos下安装软件我们采用
安装或者
- 源码
安装的方式,有时候更简单我们可以采用
- RPM包
的方式
- YUM源
安装PHP的时候有个特殊的地方,其有两个YUM源可供选择
Webtatic方式安装升级PHP
安装
源
- webtatic
- [root@i-bskmtj6q ~]# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
- Retrieving https://mirror.webtatic.com/yum/el6/latest.rpm
- Preparing... ########################################### [100%]
- 1:webtatic-release ########################################### [100%]
- [root@i-bskmtj6q ~]# ls -l /etc/yum.repos.d/webtatic*
- -rw-r--r-- 1 root root 963 Nov 13 2016 /etc/yum.repos.d/webtatic-archive.repo
- -rw-r--r-- 1 root root 865 Nov 13 2016 /etc/yum.repos.d/webtatic.repo
- -rw-r--r-- 1 root root 963 Nov 13 2016 /etc/yum.repos.d/webtatic-testing.repo
安装或者升级PHP
- ## install
- yum --enablerepo=remi install php php-*
- ## update
- yum --enablerepo=remi update php php-*
REMI方式安装升级PHP
REMI源有个
的地方,安装其前必须先安装
- 特殊
- [root@i-bskmtj6q ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- error: Failed dependencies:
- epel-release = 6 is needed by remi-release-6.9-1.el6.remi.noarch
安装 REMI源
- [root@i-bskmtj6q ~]# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
- Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
- Preparing... ########################################### [100%]
- 1:epel-release ########################################### [100%]
- [root@i-bskmtj6q ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- Preparing... ########################################### [100%]
- 1:remi-release ########################################### [100%]
- [root@i-bskmtj6q ~]# ls -l /etc/yum.repos.d/remi*
- -rw-r--r-- 1 root root 457 Jun 30 20:13 /etc/yum.repos.d/remi-php54.repo
- -rw-r--r-- 1 root root 1316 Jun 30 20:13 /etc/yum.repos.d/remi-php70.repo
- -rw-r--r-- 1 root root 1316 Jun 30 20:13 /etc/yum.repos.d/remi-php71.repo
- -rw-r--r-- 1 root root 1316 Jun 30 20:13 /etc/yum.repos.d/remi-php72.repo
- -rw-r--r-- 1 root root 2609 Jun 30 20:13 /etc/yum.repos.d/remi.repo
- -rw-r--r-- 1 root root 751 Jun 30 20:13 /etc/yum.repos.d/remi-safe.repo
安装或者升级PHP
- ## install
- yum --enablerepo=webtatic install php php-*
- ## update
- yum --enablerepo=webtatic update php php-*
说明
1、EPEL
Extra Packages for Enterprise Linux,也就是为企业级 Linux提供的扩展软件源,适用于 RHEL,CentOS,Scientific Linux系统。
2、remi
软件源对旧的fedora版本提供最新的软件支持,也可以为Centos及RHEL提供最新的软件
看官网的图标可能主要和PHP安装升级相关(个人猜测)
3、Webtatic
The Webtatic Yum repository is a CentOS/RHEL repository containing updated web-related packages. 主要供应最新LAMP等软件源
参考官网介绍 https://webtatic.com/projects/yum-repository/
来源: http://www.phperz.com/article/17/0827/344251.html