How To Install Php 5 On Centos

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.

  1. How To Install Php On Centos
  2. Install Php5 Centos 7
  3. How To Install Php 5 On Centos Server
Active2 years, 3 months ago

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.

Centos

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?

shinshin
2153 gold badges7 silver badges15 bronze badges

4 Answers

you would add repo into centos 6 by:

Next,

I hope help you!

GLifeGLife

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

Php

This makes using pear to add PHP packages easier by setting $PATH to include /opt/rh/rh-php56/root/...

LiczyrzepaLiczyrzepa

You can use REMI's repository

To enable it, follow these steps:

  1. yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  2. edit /etc/yum.repos.d/remi.repo and, under then [remi-php56] tag, set enabled=1
  3. 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
28.8k3 gold badges52 silver badges99 bronze badges
CrisMCrisM

How To Install Php 5 On Centos Server

Not the answer you're looking for? Browse other questions tagged phpcentos6 or ask your own question.