In this tutorial we will show you how to install PHP 5.6 on CentOS 7 server. For those of you who didn’t know, PHP (recursive acronym for PHP: Hypertext Preprocessor) is an open source, popular general-purpose scripting language that is widely-used and best suited for developing websites and web-based applications.
When I run yum install php php-devel php-mysql php-gd php-mbstring
, it will install php5.3.
I just removed it yum remove php php-cli php-common php-devel php-gd php-mbstring php-mysql php-pdo
.
And I tried yum install php56w php56w-devel php56w-mysql php56w-gd php56w-mbstring
, but they are not available.
How can I install php5.6 on CentOS 6?
shinshin4 Answers
you would add repo into centos 6 by:
Next,
I hope help you!
CentOS now offers Software Collections (SCL) as a repo installable from base:
Once you've installed the SCL repo, you can install php 5.6:
The CentOS documentation is slightly dated as is the Red Hat Documentation, but newer versions of php, PostgreSQL, MariaDB, MySQL, perl, ruby, etc. are available. It's also available on CentOS and RHEL 7 and is theoretically better integrated with the OS. The notes say that adding packages through SCL won't interfere with the system's utilities, such as yum.
To make the SCL version of PHP the default on the command line, run the following as root to add to the default profile:
How To Install Php On Centos
This makes using pear to add PHP packages easier by setting $PATH
to include /opt/rh/rh-php56/root/...
You can use REMI's repository
To enable it, follow these steps:
yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- edit
/etc/yum.repos.d/remi.repo
and, under then[remi-php56]
tag, setenabled=1
yum install php
Install Php5 Centos 7
Please note that, doing that, you will update the system-wide php package to the 5.6 version. If you need, for some reason, install PHP 5.6 alongside the older, CentOS-distributed relase, you had to do a more complex side-by-side installation.
shodanshokshodanshok