Sean78Black
Member
- Joined
- May 29, 2016
- Messages
- 84
- Points
- 8
To install, you need to use the extended storage of CentOS, it is EPEL and Remi repository.
Install EPEL repository
If you can not use this command, you can install via RPM:
For CentOS 5:
CentOS 6:
CentOS 7:
After you download the RPM file above, use the following command to install:
Remi repository
Remi repository is the repository for PHP on CentOS installation support PHP version 5.4 / 5.5 / 5.6 and PHP 7.
For CentOS 5:
CentOS 6:
CentOS 7:
After you download the RPM file above, use the following command to install:
To select PHP version to install, you need to enable it in the repository Remi. Open and edit file /etc/yum.repos.d/remi.repo
You can see in it parts such as: [remi] for PHP 5.4, [remi-php55] fori PHP 5.5 and [remi-php56] for 5.6. to enable the version you want to install, edit “enabled=0†to “enabled=1“.
That's all, you can use yum to install PHP-FPM and some PHP functions as follows:
To install PHP 7, use the following command:
To update PHP to a newer version, use the following command:
Ok, whether you're using CentOS 5, you can still use the new PHP version.
Good luck!
Install EPEL repository
Code:
$ sudo yum install epel-release
For CentOS 5:
Code:
$ wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
Code:
$ wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Code:
$ wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
Code:
$ sudo rpm -Uvh epel-release*.rpm
Remi repository is the repository for PHP on CentOS installation support PHP version 5.4 / 5.5 / 5.6 and PHP 7.
For CentOS 5:
Code:
$ wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
Code:
$ wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Code:
$ wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Code:
$ sudo rpm -Uvh remi-release*.rpm
Code:
$ sudo nano /etc/yum.repos.d/remi.repo
Code:
[remi] # fori PHP 5.4
name=Les RPM de remi pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
[B]enabled=1[/B]
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
[remi-php55] # fori PHP 5.5
name=Les RPM de remi de PHP 5.5 pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/php55/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/php55/mirror
# WARNING: If you enable this repository, you must also enable "remi"
[B]enabled=1[/B]
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
[remi-php56] # fori PHP 5.6
name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
[B]enabled=1[/B]
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Code:
$ sudo yum install php-fpm php-mysql php-gd php-mbstring php-pear php-xml php-xmlrpc php-devel
Code:
$ sudo yum install php70
Code:
$ sudo yum update
Good luck!