CentOS 6/7环境下通过yum安装php7的方法
作者:禾斗比不来IT 时间:2023-11-23 11:08:02
本文实例讲述了CentOS 6/7环境下通过yum安装php7的方法。分享给大家供大家参考,具体如下:
安装php7已经是现在linux服务器必备的一款工具了,只要做网站都会考虑到使用php7了,下面我们来看Centos 6/ 7下通过yum安装php7环境的教程。
2015年12月初PHP7正式版发布,迎来自2004年以来最大的版本更新。PHP7最显著的变化就是性能的极大提升,已接近Facebook开发的PHP执行引擎HHVM。在WordPress基准性能测试中,速度比5.6版本要快2~3倍,大大减少了内存占用。PHP7在语言上也有一些变化,比如添加返回类型声明、增加了一些新的保留关键字等。在安全方面,去除了PHP安全模式,添加魔术引号等。不仅如此,新版还支持64位,而且包含最新版Zend引擎。
查看 centos 版本
# cat /etc/centos-release
删除之前的 php 版本
# yum remove php* php-common
rpm 安装 Php7 相应的 yum源
CentOS/RHEL 7.x:
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
CentOS/RHEL 6.x:
# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum安装php7
# yum install php70w php70w-opcache
安装其他插件(选装)
php70w
php70w-bcmath
php70w-cli
php70w-common
php70w-dba
php70w-devel
php70w-embedded
php70w-enchant
php70w-fpm
php70w-gd
php70w-imap
php70w-interbase
php70w-intl
php70w-ldap
php70w-mbstring
php70w-mcrypt
php70w-mysql
php70w-mysqlnd
php70w-odbc
php70w-opcache
php70w-pdo
php70w-pdo_dblib
php70w-pear
php70w-pecl-apcu
php70w-pecl-imagick
php70w-pecl-xdebug
php70w-pgsql
php70w-phpdbg
php70w-process
php70w-pspell
php70w-recode
php70w-snmp
php70w-soap
php70w-tidy
php70w-xml
php70w-xmlrpc
重启 Apache
# service httpd restart
如果是Apache + PHP的话必须使用 PHPIniDir 指定php5的配置文件php.ini的路径
PHPINIDir /etc/php.ini
希望本文所述对大家CentOS服务器配置有所帮助。
来源:https://blog.csdn.net/river131/article/details/53838640
标签:CentOS,6,CentOS7,yum,安装php7
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
tornado捕获和处理404错误的方法
2023-11-27 11:03:36
Python中sub()的用法说明
2023-08-04 14:29:32
![](https://img.aspxhome.com/file/2023/9/75359_0s.jpg)
js检测浏览器语种,适合于多语言版本的站点
2007-09-12 19:16:00
Python正则表达式re模块详解(建议收藏!)
2022-07-28 04:52:46
![](https://img.aspxhome.com/file/2023/1/112021_0s.png)
Python 序列的方法总结
2021-12-12 11:14:23
jQuery判断checkbox是否选中的3种方法
2024-04-22 13:05:16
![](https://img.aspxhome.com/file/2023/6/135846_0s.png)
Python cookbook(数据结构与算法)对切片命名清除索引的方法
2023-10-31 02:27:35
python线程定时器Timer实现原理解析
2022-01-08 20:25:36
Python 任务自动化工具nox 的配置与 API详情
2022-05-02 20:57:30
asp如何显示最后十名来访者信息?
2010-06-09 18:45:00
Python文件名的匹配之clob库
2022-11-17 06:59:46
![](https://img.aspxhome.com/file/2023/5/125005_0s.png)
Python生成一个迭代器的实操方法
2022-05-08 09:34:32
![](https://img.aspxhome.com/file/2023/0/114560_0s.jpg)
python基础之文件操作
2022-12-23 01:15:53
![](https://img.aspxhome.com/file/2023/9/112149_0s.png)
python如何实现代码检查
2022-07-22 18:19:12
Pytorch 使用不同版本的cuda的方法步骤
2023-02-06 07:52:23
![](https://img.aspxhome.com/file/2023/3/114503_0s.png)
Navicat for MySQL 15注册激活详细教程
2024-01-19 00:05:16
![](https://img.aspxhome.com/file/2023/2/115552_0s.jpg)
Python在for循环中更改list值的方法【推荐】
2023-03-05 07:14:28
Oracle外键不加索引引起死锁示例
2024-01-20 20:10:08
给网站界面预留退路
2009-03-25 20:32:00
![](https://img.aspxhome.com/file/UploadPic/20093/25/01-11s.jpg)
详解django+django-celery+celery的整合实战
2022-11-14 12:25:13
![](https://img.aspxhome.com/file/2023/9/87989_0s.png)