How to Install PHP 5.6 on CentOS 7
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了How to Install PHP 5.6 on CentOS 7,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2510字,纯文字阅读大概需要4分钟。
内容图文
![How to Install PHP 5.6 on CentOS 7](/upload/InfoBanner/zyjiaocheng/969/e97d5e9e0d3c4b2aa27767ce573927d2.jpg)
By default the CentOS 7 official software package repositories have PHP 5.4, which has reached the end of life and no longer actively maintained by the developers. To keep up with the latest features and security updates, you need a newer (probably the latest) version of PHP on your CentOS 7 system.
Therefore it is strongly recommended for you to upgrade or install a latest supported stable version of PHP 5.5, PHP 5.6 or PHP 7 on a CentOS 7 Linux distribution.
In this article, we will explain how to install supported stable versions of PHP 5.5 (only security updates provided) or PHP 5.6 on CentOS 7 (same instructions also works on RHEL 7) distribution.
Installing PHP 5.6 on CentOS 7
To install PHP 5.6, you have to install and enable EPEL and Remi repository to your CentOS 7 system using the commands below.
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Next, install yum-utils which is an assortment of utilities that integrate with yum to enhance its default features, giving it more advanced package management options and also making it easier to use.
A few of its important features include manipulating repositories, enabling or disabling packages on the go and lots more, without any manual configurations.
yum install yum-utils
One of the most important program provided by yum-utils is yum-config-manager, which you can use to active Remi repository as the default repository for installing various PHP versions. For example, if you want to install PHP 5.5, PHP 5.6 or PHP 7.2 on CentOS 7, just enable it and install as shown.
yum-config-manager --enable remi-php55 [Install PHP 5.5]
yum-config-manager --enable remi-php56 [Install PHP 5.6]
yum-config-manager --enable remi-php72 [Install PHP 7.2]
Now that you’ve enabled selected versions of PHP, you can install PHP (here, we have chosen to install PHP 5.6) with all needed modules as follows
yum-config-manager --enable remi-php56 [Install PHP 5.6]
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
Important things to note:
? In case you want to downgrade the PHP version for one reason or the other, you will need to remove existing PHP version(s) and then reinstall the new PHP with modules you need.
? You can as well install multiple versions of PHP on Linux and manually choose which version to use by default.
Afterwards, double check the installed version of PHP on your system.
内容总结
以上是互联网集市为您收集整理的How to Install PHP 5.6 on CentOS 7全部内容,希望文章能够帮你解决How to Install PHP 5.6 on CentOS 7所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。